Search
14013 results 3131-3140
Forum
- 17th Mar 2014[1.10] How do I search a column with regular expression? - column().search() with Regular ExpressionThanks very much. Its takes a while, but I get there :-) Yes, fnGetData and friends will work in 1.10. The 'New API' section of the upgrade notes mentions this: http://next.datatables.net/new/1.10 Allan
- 10th Mar 2014Custom Filter to search at the beginning of each WordProblem solved, for anyone wondering, the solution was far simpler than i expected. I'm not saying this is the optimal solution, but atleast its a working one. In the server_processing.php file, there is lines for Filtering : [code] /* * Filtering * NOTE this does not match the built-in DataTables filtering which does it * word by word on any field. It's possible to do here, but concerned about efficiency * on very large tables, and MySQL's regex functionality is very limited */ $sWhere = ""; if ( isset($_GET['sSearch']) && $_GET['sSearch'] != "" ) { $sWhere = "WHERE ("; for ( $i=0 ; $i<count($aColumns) ; $i++ ) { $sWhere .= "".$aColumns[$i]." LIKE '".mysql_real_escape_string( $_GET['sSearch'] )."%' OR "; } $sWhere = substr_replace( $sWhere, "", -3 ); $sWhere .= ')'; } [/code] we are interested in the $sWhere variable, which contained previously [code] "".$aColumns[$i]." LIKE '%" [/code] Once the first % removed, it looks for the first characters an exact match as what you type in. (the second % ensure it still display all the "possible" results, not only exact matches.) Hope it helps other people, Flavio
- 4th Feb 2014Extend Search FunctionBasically you can't - its a private function. What I would suggest is you create a custom feature plug-in which just calls fnFilter (which is basically all _fnFilterCreateSearch does after it has made the input box). See: http://datatables.net/blog/Creating_feature_plug-ins Allan
- 7th Jan 2014Is there a way to "remember" the search values of column range filters? (similar to aoPreSearchCols)Thanks Allan! Looks good, and it looks like what I was looking for.
- 12th Dec 2013How can I put the search label inside the input?Oh wow :) That was simple. Thank you so much!
- 9th Dec 2013GROUP BY breaks Search functionI was able to figure it out using $sGroup = "GROUP BY accounts.accountname"; Added $sGroup after $sWhere Thank you
- 9th Dec 2013Search Function stops when using GROUP BY in server processingI was able to figure it out using $sGroup = "GROUP BY accounts.accountname"; Added $sGroup after $sWhere Thank you
- 22nd Nov 2013How I hide searchAgreed - sDom is how to control what controls DataTables adds to the document. Allan
- 13th Jun 2013search value for other than datatable columnsyou can use fnServerParams see the reference documentation on http://datatables.net/ref [quote] It is often useful to send extra data to the server when making an Ajax request - for example custom filtering information, and this callback function makes it trivial to send extra information to the server. The passed in parameter is the data set that has been constructed by DataTables, and you can add to this or modify it as you require. [/quote] you can push the value of your checkbox onto the aoData array [code] $(document).ready( function() { $('#example').dataTable( { "bProcessing": true, "bServerSide": true, "sAjaxSource": "scripts/server_processing.php", "fnServerParams": function ( aoData ) { aoData.push( { "name": "status", "value": $('#my_secret_checkbox').val() } ); } } ); } ); [/code]
- 4th Jun 2013Hidden columns and search mismatchsorry for double posting, working link here http://s24.postimg.org/uyat0hw5x/image.jpg