Search
11455 results 2061-2070
Forum
- 6th Oct 2022How can I filter multi-value cells?Link to test case: https://stackoverflow.com/q/73965727/679449 Debugger code (debug.datatables.net): Error messages shown: none Description of problem: I have some rows with cells containing multiple values. The counts appear correctly in the search pane, but when clicked, do not show the rows containing the multiple values. See row #1 which has two "Offices". Any suggestions?
- 6th Jul 2022How to Show Scrollbars and Not Have UnAligned Cols and missing Filter Box When Ajaxly Load DataTitle', title: { 0: 'Search Filters', _: 'Search Filters (%d)' }, value:
- 21st Jun 2019How can i use ajax ,data filter outside datatable there is any api ??My table columns generate by dynamically .. i want to map my json response with datatable - how can i use Ajax dataFilter: function(data){} outside my Ajax request. - i want to use this AJAX method in my code where i put this dataFilter: function(data){ var json = jQuery.parseJSON( data ); var resellerreponce = json.searchResults; json.data = resellerreponce.List; json.recordsFiltered = resellerreponce.sCount; json.recordsTotal =resellerreponce.ResultsCount; return JSON.stringify( json ); } // This is my actual code for dynamic columns $.ajax({ url: "Abc.do?action=Items", success: cb_func }); }); function getData(cb_func) { getData(function (data) { Jdata = data.searchResults.Summary; var columnNames = Object.keys(Jdata[0]); for (var i in columnNames) { columns.push({ data: columnNames[i], title: columnNames[i] }); $('#example').DataTable({ data: Jdata, columns: columns }); });
- 21st Mar 2019Problem for sum each column + filter rowsHello, I want to make a table to be able to help me make price comparisons. Explanations: In my table I have : - Project - Product - Manufacturer - Title - Quantity - Unit buying price (sum) - Total price buying (sum) - Multiply (average) - Unit sales price (sum) - Total sales price (sum) - Profit (sum) - The ideal in my case would be to select the lines I want to keep to see the total price of my choices. So I can see the cost of different options. someone would have an idea or have already encountered this problem? The script i use : https://jsfiddle.net/#&togetherjs=xsj2oRC44B html : <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css" /> <!-- /DataTables js / --> <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.js"></script> <table id="example" class="display nowrap table1" cellspacing="0" width="100%"> <thead> <tr> <th>projectid</th> <th>productid</th> <th>manufacturerid</th> <th>title</th> <th>quantity</th> <th>PAU a</th> <th>PAT a</th> <th>Coef a</th> <th>PVU a</th> <th>PVT a</th> <th>Profit a</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>5</td> <td>5</td> <td>Title 1</td> <td>10</td> <td>130</td> <td>1300</td> <td>2</td> <td>260</td> <td>2600</td> <td>1300</td> </tr> <tr> <td>2</td> <td>3</td> <td>6</td> <td>Title 2</td> <td>10</td> <td>100</td> <td>1000</td> <td>2</td> <td>200</td> <td>2000</td> <td>1000</td> </tr> <tr> <td>3</td> <td>2</td> <td>5</td> <td>Title 3</td> <td>10</td> <td>50</td> <td>500</td> <td>2</td> <td>100</td> <td>1000</td> <td>500</td> </tr> </tbody> <tfoot> <tr> <th></th> <th></th> <th></th> <th></th> <th></th> <th>PAU a</th> <th>PAT a</th> <th></th> <th>PVU a</th> <th>PVT a</th> <th>Profit a</th> </tr> </tfoot> </table> </div> <script> var intVal = function ( i ) { return typeof i === 'string' ? i.replace(/[\$,]/g, '')*1 : typeof i === 'number' ? i : 0; }; $(document).ready(function() { var table = $('#example').DataTable( { responsive: true, scrollX: true, scrollCollapse: true, paging: true, lengthChange: false, lengthMenu: [ [10, 25, -1], [10, 25, "All"] ], "order": [[ 0, "asc" ]], "footerCallback": function ( row, data, start, end, display ) { var api = this.api(), data; var sumColumns = [5,6,8,9,10] sumColumns.forEach(function(colIndex){ // Total over all pages var total = api .column(colIndex) .data() .reduce( function (a, b) { return intVal(a) + intVal(b); }, 0 ); // Total over this page var pageTotal = api .column(colIndex, { page: 'current'} ) .data() .reduce( function (a, b) { return intVal(a) + intVal(b); }, 0 ); // Update footer $( api.columns(colIndex).footer() ).html( total ); }) }, buttons: ['pdf'] }); table.buttons().container() .appendTo( '#example_wrapper .small-6.columns:eq(0)' ); }); </script> Thanks for help
- 17th Aug 2018Filter Box for multiple SelectHello, I'm trying to make the multi-select box larger, on small items like age, it's not wide enough to show all the data. This is an example: http://live.datatables.net/xehexoye/1/edit I'm 99.9% sure it's in the select2.min.css, but I'm not sure exactly which setting is causing it not to be larger enough. I'm thinking padding and I've changed a bunch with no change. Can anyone point me in the direction of how to know which setting needs to be changed? Thanks for your help
- 9th Aug 2018Custom filter columns[0][search][value] remains emptyI made a custom filtering option for my DataTable
- 31st Jul 2018Easy way to get Page Length, Page Size and Search Filter from datatable to Java?size and the search filters in Java side to
- 27th Mar 2018Export excel and filter datatable activatedHi, I have a problem with the export xls when the filters are activated. In excel all columns are a big size. Have you a solution ? Thank you
- 1st Feb 2018Hi can someone please help me with this situation about datatables and date range filter by RadCorpcurrently I'm using a Ajax for my data to be loaded/fetch in my datatable my problem is that when i tried to run my code the datatable is not showing up even though it is being catch in the console.log that i've used for testing purpose. and it is not working even though there is no error in the code that I'm using :( $(document).ready(function() { var table = $('#example').DataTable( { "ajax": "js/datatables/datatableAdminGenerateFullReport.json", "columns": [ { "mData": "ID #" }, { "mData": "Name" }, { "mData": "Transaction Date" }, { "mData": "Transaction ID"}, { "mData": "Currency" }, { "mData": "Amount" }, { "mData": "Source"}, { "mData": "Status"} ], dom: 'Bfrtip', lengthChange: false, buttons: [ { extend:'copyHtml5', text: '', titleAttr: 'Copy', messageTop: 'The information in this table is copyright to AU Remit.' }, { extend: 'excelHtml5', text: '', titleAttr: 'Excel', messageTop: 'The information in this table is copyright to AU Remit.' }, { extend: 'pdfHtml5', text: '', titleAttr: 'PDF', textAlign: 'center', messageBotom: 'The information in this table is copyright to AU= Remit.' }, { extend: 'colvis' } ] }); table.buttons("#example_filter").container().insertAfter('#example_filter'); }); $("#min, #max").keyup( function(){ table.draw(); }); $.fn.dataTable.ext.search.push( function( settings, data, dataIndex ){ console.log("hello"); var arr_min = parseInt($("#min").val()); var arr_max = parseInt($("#max").val()); var arr_date = parseFloat(data[2]) || 0; var iMin = new Date(Date.parse(arr_min)); var iMax = new Date(Date.parse(arr_max)); var iDate = new Date(Date.parse(arr_date)); if (iMin == "" && iMax == "") { return true; } else if (iMin == "" && iDate <= iMax) { return true; } else if (iMin <= iDate && "" == iMax) { return true; } else if (iMin <= iDate && iDate <= iMax) { return true; } return false; } );
- 21st Jan 2018how to get case data value in dropdown filter'''$(document).ready(function () { $.ajax({ url: 'StudentService.asmx/GetStudents', method: 'post', dataType: 'json', success: function (data) { $('#datatable').on('processing.dt', function (e, settings, processing) { $('#processingIndicator').css('display', processing ? 'block' : 'none'); }) .DataTable({ initComplete: function () { this.api().columns([3,4]).every(function() { var column = this; var select = $('<select><option value="">ALL</option></select>') .appendTo( $(column.header()).empty() ) .on( 'change', function () { var val = $.fn.dataTable.util.escapeRegex( $(this).val() ); column .search( val ? '^'+val+'$' : '', true, false ) .draw(); } ); column.data().unique().each( function ( d, j ) { select.append( '<option value="'+d+'">'+d+'</option>' ) } ); } ); }, paging: true, sort: true, searching: true, scrollY: 450, scrollX: 1800, "lengthMenu": [[19, 25, 50], [19, 25, 50]], columnDefs: [{ type: "salary-grade", targets: [3], orderData: [3, 4, 1], }], order: [[3, "asc"]], data: data, columns: [ { 'data': 'id' }, { 'data': 'name' }, { 'data': 'fname' }, { 'data': 'CLASS' }, { 'data': 'section' }, { 'data': 'contact', 'sortable': false, 'searchable': false }, { 'data': 'sex', 'render': function (data, type, row) { switch (data) { case 'Male': return 'free'; break; case 'Female': return 'paid'; break; default: return 'N/A'; } } }, { 'data': 'dob', 'render': function (jsonDate) { var date = new Date(parseInt(jsonDate.substr(6))); var month = date.getMonth() + 1; return date.getDate()+"-" + month + "-" + date.getFullYear(); } }, { 'data': 'address' }, { 'data': 'admdate', 'render': function (jsonDate) { var date = new Date(parseInt(jsonDate.substr(6))); var month = date.getMonth() + 1; return date.getDate()+"-" + month + "-" + date.getFullYear(); } }, { 'data': 'session', 'render': function (data, type, row) { switch (data) { case '1015': return '2017-18'; break; case '1016': return '2018-19'; break; default: return 'N/A'; } } }, { 'data': 'type', 'render': function (data, type, row) { switch (data) { case 'True': return 'Old'; break; case 'False': return 'New'; break; default: return 'N/A'; } } } ] }); } }); }); </script>'''