Search
10705 results 221-230
Examples
- Buttons › Space between buttonsThe
spacer
button type is unique in Buttons in that it doesn't actually display a button or anything the end user can interact with. Rather it simply introduces a space between buttons, allowing easy visual grouping. - Buttons › Select integration - export selected rowsButton's data export can interface with the Select extension for DataTables, and will automatically export only the selected rows, if any rows are selected. If no rows are selected in the table, all rows will be exported. If this behaviour is not what you desire, set the
selected
option of theexportOptions.modifier
in the button you wish disable this action for to benull
. It will then include all rows in the export, regardless of any rows being selected (the Print button in this example demonstrates this). Equally, if you want to force the export to include only exported rows, even if no rows are selected (i.e. none would be exported), set this parameter to betrue
. - Buttons › Page length (button)Buttons are often inserted into the document where DataTables default page length
select
width would go (top left), to provide controls or table information at each of the four corners of the table. However, you may wish to keep still allow the end user to change the page length, while also providing buttons. ThepageLength
button acts in exactly the same way as the default length list, but is available as a standard button that uses a collection to display the options. This example shows thepageLength
button being used. - Buttons › Multiple button groupsDue to Buttons being registered with DataTables as a feature you can create multiple different button groups, each with its own set of buttons and addressable by the API. This can be particularly useful if you wish to display button groups with different functionality (file export, editing, etc). In this example the
buttons
feature is used twice to insert one button at the top of the table and another two at the bottom. - Buttons › Keyboard activationKeyboard navigation is essential for fast navigation of a table operations and also for good accessibility. Buttons provides the ability to give each button a key binding - i.e. a key combination that when pressed will activate the button's action. The key binding can be given as a single character if you wish to listen for an unmodified key press, or as an object if you wish it to only be activated when a modifier key such as shift, alt, etc, is pressed. Only when there is no element on the page that has focus will Buttons act on a key press. This means that if you search for (for example) 1 in the DataTables search box, it will not activate Button 1 in this example. Having said that, adding a modifier key, such as shift or alt can often be useful to prevent accidental triggering of a button. This example shows two buttons; the first will be activated if
1
is pressed on the keyboard. The second requiresshift + 2
to be pressed. - Buttons › File exportExporting data from a table can often be a key part of a complex application. The Buttons extension for DataTables provides three plug-ins that provide overlapping functionality for data export: HTML5 export buttons - makes use of HTML5 APIs to create files client-side Print button Both sets of buttons provide: Copy to clipboard Save as Excel (XLSX) Save as CSV Save as PDF Display a print view Buttons provides button types that will alias HTML5 buttons. These are:
copy
,csv
,excel
,pdf
. This example shows those four button types, plusprint
, being used with all required dependencies being loaded. - Buttons › Custom HTML in Buttons CollectionThis example shows how custom HTML can be used to break up buttons. This has a wide variety of use cases, here we are using it in the popover to add relevant headings to better describe the buttons functionality. There is nothing to limit you here, you can create whatever you please and display it within the buttons collection.
- Buttons › Multi-level collectionsAs of Buttons 1.1, basic options for displaying a collection inside a collection is possible simply by using a collection button in the
buttons
array for another collection. This Inception like behaviour basically means that multi-level collections are possible. It is worth noting that only a single collection can be shown at a time, so the display of any sub-collection will replace the display of the existing collection. This example shows a custom collection button (matching the simple collection example) with the addition of a column visibility button, which when activated will show another collection of buttons, this time controlling the column visibility. - Buttons › Auto close collectionButtons' collections will remain on screen when a sub-button is activated by default, but this behaviour isn't always desirable and can be controlled through the use of the
autoClose
option as shown in this example. In every other regard it is identical to the collections example but in this case the collection will close automatically when one of the sub-buttons is selected. - AutoFill › Scrolling DataTableWhen dragging an AutoFill handle, the table (if DataTables scrolling is enabled) or the window will be automatically scrolled, as you approach the edge of the scrolling component. The example below shows the effect with DataTables scrolling (and also window if needed).
Forum
- 21st Feb 2024After Reinitialize header and body not alignedI had a similar issue related to the misalignment header & body columns. I resolved it by removing destroy: true from the table init. Also changed the instance retrieval code. . https://datatables.net/manual/tech-notes/3#Object-instance-retrieval
- 19th Feb 2024how can I tigger a search in the searchPanes extension?Thanks, @kthormann ! This doesn't seem to work with long searchPane tables, as they're not automatically loaded into the DOM on init. I don't suppose there's a way to enforce this? Thanks!
- 17th Feb 2024Which editor version can I download?I will post the init code when I am
- 16th Feb 2024Immediately invoked function for column title no longer works w/ 2.0part of the DataTables init is fully synchronous, I
- 11th Feb 2024ckeditor5 Document editor(DecoupledEditor) Integratei try below code ... _fieldTypes[fieldType] = { create: function (conf) { var that = this; var id = DataTable.Editor.safeId(conf.id); conf._input = $('<div id="' + id + '"></div>'); DecoupledEditor.create(conf._input[0], conf.opts) .then(function (editor) { // const toolbarContainer = document.querySelector('#toolbar-container'); $('#toolbar-container').append(editor.ui.view.toolbar.element); conf._ckeditor = editor; }) .catch(error => { console.error(error); }); return conf._input; }, ... toolbar not init.
- 8th Feb 2024Add a second row to a footercould comment you the init code hand verify how
- 28th Jan 2024is there a way to generate a sharable link for datatable that uses searchPane, a code ex. would helpclicking the link, on "init" of the respective data
- 11th Jan 2024Resetting width of DataTab;le in tabssense to use the "init" event. It might also
- 10th Jan 2024Why did I delete the loading Indicator?css) and your Datatables init code. Better would be
- 29th Dec 2023Editor post submit breaking columns created cellfull Editor and Datatables init code. Use the browser's