Search
11456 results 8891-8900
Forum
- 4th Feb 2020Use 'Index Column' and 'Column Filters' features togetherHi Kevin, Thank you very much. I will follow that way next time. I have fixed the issue for now. Following code worked for me successfully. $(document).ready(function() { // Setup - add a text input to each footer cell $('#OrdersTable thead tr').clone(true).appendTo( '#OrdersTable thead' ); $('#OrdersTable thead tr:eq(1) th').each( function (i) { var title = $(this).text(); $(this).html( '<input type="text" placeholder="Search '+title+'" />' ); $( 'input', this ).on( 'keyup change', function () { if ( table.column(i).search() !== this.value ) { table .column(i) .search( this.value ) .draw(); } } ); } ); var table = $('#OrdersTable').DataTable( { orderCellsTop: true, fixedHeader: { header: true, footer: true }, "columnDefs": [ { "searchable": false, "orderable": false, "targets": 0 } ], "order": [[ 1, 'asc' ]] } ); table.on( 'order.dt search.dt', function () { table.column(0, {search:'applied', order:'applied'}).nodes().each( function (cell, i) { cell.innerHTML = i+1; } ); } ).draw(); } );
- 24th Oct 2019Column filtering with hidden field returns search for wrong columnFantastic! Datatables is simple, yet can get complex as you tailor it, which should be expected. It seems that you have worked out most of the issues which indicates a reasonably mature product. When possible, its definitely worth the time to drill down a problem to the smallest scope possible, and post a link from the live site. Solutions are usually pretty quick then.
- 20th Aug 2019How do you make your own filters and buttonsHi @Wiezo , This example here should help - it's showing that. Cheers, Colin
- 16th Jul 2019How do I add checkbox filtering to a DataTable?You may be interested in this thread too. Its a simplified version of Colin's example. Just more options to show how this can be done :smile: Kevin
- 15th Mar 2019Cant Get Column Filters Working On My DTFigured, it was because i had the following set to false searching: false
- 7th Feb 2019Custom Filtering (specifically greater than) server-sideLastly, there is https://datatables.net/reference/option/ajax.data (probably the right answer) . But this example seems more towards finding a specific word like searching a first name for Fred. Not finding "math" variables like below $100.
- 9th Jan 2019filtering (based loosely on column filtering example), but with a numeric or date rangeHere is a number range example that might get you started: https://datatables.net/examples/plug-ins/range_filtering.html Kevin
- 10th Dec 2018Datatable not filtering with datepickerWithout seeing a test case its hard to say but I suspect the problem is due to passing a float to the moment function moment(date).isSameOrAfter(min). According to the docs it takes a string with certain formats: https://momentjs.com/docs/#/parsing/string/ You need to troubleshoot what is going on with your if statement. The comparison is always returning false. Kevin
- 16th Oct 2018Upgrading from 1.10.15 to 1.10.18 breaks (multiple column) smart filtering?During my workflow I minify all my js-files with grunt (not using your supplied minified version). The eslint-task throws a few errors, including the computed-property-spacing error among others (no trailing spaces, no tabs, no unsed vars, ...). For example, it wants [ variable ] to be [variable] without the spaces. When replacing ] with ] (without a space), it also changed some regular expressions in the source code, resulting in my problem. I will just ignore these errors for now and have marked your last post as the answer to my question so it does not show up as unanswered anymore. Thanks for your help and best regards!
- 11th Oct 2018Undefined index error when creating a new row, on page that filters for dataOk I got it. I created a second editor instance for the row creation, and directed the buttons to call it. Now it works. var editor2 = new $.fn.dataTable.Editor( { ajax: '/index.php/Ajax/subUnit', table: '#subUnit', fields: [ { "label": "dataname:", "name": "dataname" }, { "label": "design:", "name": "design" }, { "label": "actual:", "name": "actual" } ] } ); and buttons: [ 'pdf', { extend: 'create', editor: editor2 }, { extend: 'edit', editor: editor2 }, { extend: 'remove', editor: editor2 } ]