Custom Filtering with Exact Match
Custom Filtering with Exact Match
Dear all,
I am trying to have a drop-down list in order to do custom column filtering.
But, I can not obtaing an exact filter match. i.e. "1" is "1" no "11" or "21" or "1x" or "x1"
You can check my tables in this url: http://www.rlmm.org/ojs-files/library.php
Can you help how to modify my existing code?
Regards,
I am trying to have a drop-down list in order to do custom column filtering.
But, I can not obtaing an exact filter match. i.e. "1" is "1" no "11" or "21" or "1x" or "x1"
You can check my tables in this url: http://www.rlmm.org/ojs-files/library.php
Can you help how to modify my existing code?
Regards,
This discussion has been closed.
Replies
you need to add extra regular expression in your string...try this...i am sure it will help you.. don't forget to disable regx in filter function.
[code]
valueNeedtoFilter = "^\\s*"+data+"\\s*$";
oTable.fnFilter(valueNeedtoFilter ,iColumn,false,);
[/code]
You can see this post also...http://datatables.net/forums/comments.php?DiscussionID=4096&page=1#Item_5
Thanks,
Vivek
[code]
sortby = "^\\s*"+data+"\\s*$";
oTable.fnFilter(sortby, iColumn, true);
[/code]
This is my code
$("#fromDate").change( function () {
var oSettings = oTable.fnSettings();
oSettings.aoPreSearchCols[ 3 ].bRegex = false;
oSettings.aoPreSearchCols[ 3 ].bSmart= false;
var valueNeedtoFilter = "^\\s*"+this.value+"\\s*$";
oTable.fnFilter( valueNeedtoFilter, $(".filters th input").index(this),true);
} );
Any one help me
Allan
Allan
I have the following values in table
Jul 15, 2012
Jul 5, 2012
Using Date calendar am display Jul 5, 2012. It's displaying two values. am used the above posted code only.