Search
3647 results 361-370
Forum
- 1st Aug 2016Search is not working on cells that use 'fnCreatedCell'Looks good to me :smile: Allan
- 4th Feb 2016Search table with input fields in cellsTry something along the lines of: var dtApi = null; $.fn.dataTable.ext.search.push(function(settings, data, dataIndex) { if ( ! dtApi ) { dtApi = new $.fn.dataTable.Api( settings ); } console.log( dtApi.row( dataIndex ).node() ); return false; }); $('input[name=filterNumeroFattura]').on('keyup', function() { table.draw(); }); I would suggest not adding a new filter to the array on every key press - although the push / pop was a clever way of doing it. But it wouldn't be present if your user sorted the table for example. The dtApi variable is used to access the DataTables API, and I've stored it in a variable so it doesn't need to be created on every single filter call. Allan
- 12th Jan 2016How define onclick in cells$('#example tbody').on('dblclick', 'td', function () { var tr = $(this).closest('tr'); var row = table.row( tr ); console.log(row.data()); } ); this will console log all row columns when you dbl click any row cell. perhaps you can place data1 and data2 as hidden columns on the table then call them in your function function_you_want(row.data().data1, row.data().data2).
- 15th Sep 2015Print Button: keep classes in cells and rowsi used that w.find('td:nth-child(1)').addClass(,) , problem solved!
- 5th Aug 2015Update cellsNice - thanks for the link. I hadn't seen that one before! Allan
- 17th Jun 2015get the value of two or more cells from a row , option leftjoinHola Allan, Certainly your proposal will be ideal, but actually Is not usual that a client change the name, my be the type of society S.A. to S.L. If a client change all of his name, we consider create a new client. My proposal is redundant . But in the future , these tables interact with another tables and my intention was to save as much data as possible in the same table , in order to do more easy futures joins and exports. Well, I rethink the project at the same way that the exemples and you propose. Thanks Allan
- 26th Apr 2015How to combine cells or use 2 data in one cellperfect, thank you very much!
- 19th Feb 2015How to programmatically update a cell's value?Okay - but the point still stands. The data must be submitted somewhere processed and stored, then the data returned as per the client / server communication. Allan
- 19th Dec 2014Using data-search when cells contain buttons, etc.I found a workaround. Don't try to search the column that doesn't play well with the built-in search feature. Instead, make it non-searchable, and add a new column to support searching the relevant data from the non-searchable column. Something like this: js "columnDefs": [ ... { "targets": 5, "render": RenderDropdown, "searchable": false }, { "targets": 6, "render": RenderSearchData, "visible": false } ... ] In this case, the RenderSearchData function retrieves the text for the selected dropdown value in the other column, and returns that text. That meets the need. What I like so far about DataTables is that workarounds for a slightly funky use case like this can be implemented using built-in features. Very nice.
- 26th Nov 2014Sorting dd/mm/yyyy to ignore empty cellssolution here : http://stackoverflow.com/questions/27143582/sorting-a-jquery-datatable-dd-mm-yyyy-to-ignore-empty-cells/27145293