Search
11364 results 2141-2150
Forum
- 17th May 2014Reset Result FilterOlá, bom dia a todos! No meu projeto (server-side) adicionei date-range para pesquisa de intervalo de datas, onde está funcionando perfeitamente. Porém estou com um problema no momento de limpar a pesquisa. Estou utilizando o seguinte código para limpar os campos e retornar o resultado inicial: "sButtonText": " Limpar", "fnClick": function ( nButton, oConfig, oFlash ) { var oSettings = oTable.fnSettings(); for(iCol = 0; iCol < oSettings.aoPreSearchCols.length; iCol++) { oSettings.aoPreSearchCols[ iCol ].sSearch = ''; } oTable.fnDraw(); $("#example :input").each(function(){ $(this).val(''); }); } } Quando efetuo a pesquisa por um único campo, o retorno é satisfatório, porém quando utilizo o date-range, preciso acionar o comando acima 2x para poder limpar o resultado e retornar aos dados iniciais. Alguém poderia me dar uma ajuda? Grande abraços a todos.
- 11th Apr 2014Shrinking column filter date-range inputThis is the basic code example. The goal is to reduce input width. [code] $(document).ready(function() { $('#example').dataTable() .columnFilter({ sPlaceHolder: "head:before", aoColumns: [ null, { type: "date-range" } ] }); }); [/code]
- 27th Feb 2014Server Side, Know if filter throws the ajax call.Is it possible to know when the ajax call comes to the server if the call is thrown by pagination, filtering or sorting?
- 31st Oct 2013Filter Highlighting - Filter &Hi, im using this code from this Forumpost to highlight the filtered data. which means if i type "as" it highlights all "as" in the table. works fine so far. but if i search for "nb" or "am". the script makes also the "&" and " " visible and higlighted. how can i modify the regex or something else so it ignores these expressions? Because in the table i have things like "Multi & Media" which the script does to: "Multi & Media if i type in "am" http://live.datatables.net/ukapoc/10 <-- in this case he don't finds the amp when tiping "am"... but he shows & if i search for &... i dont get it...its the same code as mine O.o Here is the fiddle, but i don't know how to make it complete work :/ http://jsfiddle.net/exk9h/1/ [code] // HIGHLIGHT FCT jQuery.fn.dataTableExt.oApi.fnSearchHighlighting = function(oSettings) { // Initialize regex cache oSettings.oPreviousSearch.oSearchCaches = {}; oSettings.oApi._fnCallbackReg( oSettings, 'aoRowCallback', function( nRow, aData, iDisplayIndex, iDisplayIndexFull) { // Initialize search string array var searchStrings = []; var oApi = this.oApi; var cache = oSettings.oPreviousSearch.oSearchCaches; // Global search string // If there is a global search string, add it to the search string array if (oSettings.oPreviousSearch.sSearch) { searchStrings.push(oSettings.oPreviousSearch.sSearch); } // Individual column search option object // If there are individual column search strings, add them to the search string array if ((oSettings.aoPreSearchCols) && (oSettings.aoPreSearchCols.length > 0)) { for (var i in oSettings.aoPreSearchCols) { if (oSettings.aoPreSearchCols[i].sSearch) { searchStrings.push(oSettings.aoPreSearchCols[i].sSearch); } } } // Create the regex built from one or more search string and cache as necessary if (searchStrings.length > 0) { var sSregex = searchStrings.join("|"); if (!cache[sSregex]) { var regRules = "(" , regRulesSplit = sSregex.split(' '); regRules += "("+ sSregex +")"; for(var i=0; i<regRulesSplit.length; i++) { regRules += "|("+ regRulesSplit[i] +")"; } regRules += ")"; // This regex will avoid in HTML matches cache[sSregex] = new RegExp(regRules+"(?!([^<]+)?>)", 'ig'); } var regex = cache[sSregex]; } // Loop through the rows/fields for matches jQuery('td', nRow).each( function(i) { // Take into account that ColVis may be in use var j = oApi._fnVisibleToColumnIndex( oSettings,i); // Only try to highlight if the cell is not empty or null if (aData[j]) { // If there is a search string try to match if ((typeof sSregex !== 'undefined') && (sSregex)) { this.innerHTML = aData[j].replace( regex, function(matched) { return "<span class='filterMatches'>"+matched+"</span>"; }); } // Otherwise reset to a clean string else { this.innerHTML = aData[j]; } } }); return nRow; }, 'row-highlight'); return this; }; [/code]
- 24th Oct 2013bStateSave:true and filter: date-rangeHi, not work bStateSave with date-range. How to fix it?
- 23rd Oct 2013How does one filter out a single value and still see all others?I'd like to apply filtering to the column in
- 9th Oct 2013FixedColumns and Filtersides, and also have filters on the columns (on
- 24th Sep 2013Filter Table By Past Number of Days (Past 7 Days, Past 15 Days, Past 30 Days)approach the problem of filtering a data table given
- 12th Sep 2013indivisual column filter in datatables/* Define two custom functions (asc and desc) for string sorting */ $(document).ready(function() { oTable = $('#listing').dataTable( { "bProcessing": true, "bServerSide": true, "sAjaxSource": "master_distributor/productsList.php", "aoColumns": [ { "mData": "product_name" }, {"mData": "product_id"}, { "mData": "parent_id","sClass": "txtCenter" }, { "mData": "action",'bSortable': false,"sClass": "txtCenter" } ], }).columnFilter({ aoColumns: [ { type: "text"}, { type: "text" }, { type: "text" }, null ] }); } ); In above i want to add action as a column in my datatable. but it is not working. Here action is the json resoponse from my ajax page
- 31st Aug 2013multifiletersearch not working while using colvis and multi filter search togetherHi Allan, I am using colvis and multi search together, but it has some issue though.. Cases: 1. If I uncheck 'Rendering Engine', and use multi-search for Engine Version (e.g. with data data 6 or 7), it wont give any data. 2. for multi-serach for CSS grade, it wont search at all I've created jsfiddle. Please hav a look... http://jsfiddle.net/AmsJy/10/ Great Thanks....Cheers !!