Search
11455 results 2071-2080
Forum
- 4th Jan 2018How to set a default value in the multi filter select?Hello! I'd like to set a default value in one of the camps of the multi-filter select (https://datatables.net/examples/api/multi_filter_select.html) I'd also like to set the default searchbar text to said value. Is it possible to do both? Thanks!!!
- 8th Dec 2017How to Filter the bootstrap DataTable with Daterange on Date column and text columnI am using bootstrap datatable with date column and more than one text columns. I want to apply filters on date column(Daterange) and text column on button click event. The table also have paging also.
- 21st Oct 2017Cannot customize Search Box and Filter Box with css class when translatingHi, When I use translation the customization on both fiedls stop working. Can someone help me? This is my code: $(document).ready(function () { $.ajax({ url: "Default.aspx/generateData", type: "POST", dataType: "json", contentType: "application/json; charset=utf-8", success: function (retorno) { $('#myTable').DataTable({ data: JSON.parse(retorno.d), dom: "<'row'<'col-sm-6'l><'col-sm-6'f>>" + "<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-5'i><'col-sm-7'p>>", language: { url: 'https://cdn.datatables.net/plug-ins/1.10.16/i18n/Portuguese-Brasil.json' }, createdRow: function (row, data, dataIndex) { if ((data['dtencerramentoalerta'] == null) || (data['dtencerramentoalerta'] == '')) { $(row).addClass("danger"); } else { $(row).addClass("warning"); } }, order: [[ 2, "desc" ]], columnDefs: [ { className: "text-center", "targets": [0, 1, 2, 3, 4] }, { orderable: false, "targets": [4] } ], columns: [ { 'data': 'column1' }, { 'data': 'column2' }, { 'data': 'column3' }, { 'data': 'column4' }, { 'data': null, 'fnCreatedCell': function (nTd, sData, oData, iRow, iCol) { $(nTd).html("<a href=test.aspx?data=" + oData.column5+ "><i class=\"fa fa-area-chart fa-fw\"></i></a>"); }, 'bSearchable': false } ] }); }, complete: function () { $('div.dataTables_filter input').addClass("form-control"); $('div.dataTables_filter input').addClass("input-sm"); $('div.dataTables_length select').addClass("form-control"); $('div.dataTables_length select').addClass("input-sm"); } }); }); If I remove the following lines the css classess are applied successfully: language: { url: 'https://cdn.datatables.net/plug-ins/1.10.16/i18n/Portuguese-Brasil.json' }, Cheers
- 25th Sep 2017Way to retain individual column filter after table refresh after updateHi, I have used multi-select drop-down for individual column filtering. I am updating data of table and reloading table again but it loses its selected values after that. Is there any way to retain this drop-down selection?
- 19th Aug 2017How to order and filter asyncwhile it's doing it's filtering. So the way i
- 30th Jun 2017Filter and bind the data to the DatatableHello all, I am binding the Large unsorted object data to datatable. My code is below: var ExpenceDataTableElement = $('#ExpenceDataTable').DataTable({ data: Data, pageLength: 10, "bSort": false, "autoWidth": false, columns: [{ "className":"clsAction", "data": "TimesheetUID", "title": "Action", "render": (data, type, row) => '', "width": "4%", "visible":true }, { "className":"clsPeriodName", "data": "PeriodName", "title": "Timesheet Name", "visible":true }, { "className":"clsTSPeriodStatus", "data": "Open", "title": "Timesheet Period Status", "render":function(data,type,row){ if(data == 1){return " Open"}else{return " close"}}, "width": "10%", "visible":true } ], "oLanguage": { "sEmptyTable": "No Records found." } }); The data contains more than 15 thousands of records, it contains the flag like 'Open' OR 'Close'. Currently I am using the for loop to sort the data and bind it to the data - table. Means if data have 15 thousand of records and it contains 7 thousands of 'Open' flag records, it takes long time to sort & bind the data to Datatable. Hence Is there any way to check the condition in 'columns:' if flag is not 'Open' then continue to the next iteration??
- 27th Jun 2017Filter when users selects empty and some valuei am using column filters. I have created my
- 18th Jun 2017Decimal column filtering and column name filter problemstextbox there is no filtering and datatables shows all
- 3rd May 2017Search filter select not working for arrayHi, First of all, thanks for your help in advance and datatable is great. I have question about the following code: if (idx === 3) { dt.column(3, { search: 'applied' }) .data(toString) .unique() .sort() .each(function (d, j) { { if (renderFunction == null) { select.append('' + d + ''); } else { select .append('' + renderFunction(d, 'display', null) + ''); } } }); } The issue is the column.data is actually a list of string from view model. In this case, it is an array, and from other posts I know unique does not work for arrays. I tried to use tostring to convert the data before calling unique, but it's not working. I can't really figure this out. Could anyone help on that? Thanks!
- 25th Apr 2017DataTables-Find data in a table, but do not filter on the server sideI want to load the data on the server side (server side) but when looking for any content I do not want to be server side with sql queries for example: Quiero cargar los datos del lado del servidor (server side) pero a la hora de buscar cualquier contenido no quiero que se haga del lado del servidor con consultas sql por ejemplo: if( !empty($params['search']['value']) ) { $where .=" WHERE ( nombre LIKE '%".$params['search']['value']."%' )"; $where .=" OR employee_salary LIKE '".$params['search']['value']."%' "; $where .=" OR employee_age LIKE '".$params['search']['value']."%' )"; } Is there any way to do this?