Regex filtering

Regex filtering

tiitremmeltiitremmel Posts: 5Questions: 0Answers: 0
edited March 2011 in General
I have a column where is only three options data. one is 'OK', second 'Mitte OK', third is empty - How could i filter only empty, only OK and only Mitte OK, but just the specific column?

[code]
oTable = $('#example').dataTable( {

"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "media/server_processing_id.php",
'iDisplayLength': 10,
'sPaginationType': 'full_numbers',
"bJQueryUI": false,
"bStateSave": false,
'bAutoWidth': true,

"aoColumns": [
null,
null,
null,
null,
null,
{ "bVisible": false },
{ "bVisible": false },
null,
null,
{ "bVisible": false },
{ "bVisible": false },/*this is the specified column*/
{ "bVisible": false },
null,
{ "bVisible": true }
],
'aaSorting': [[ 12, "desc" ]]
} );
[/code]

Replies

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin
    I think you'll need a custom filter for this ( http://datatables.net/development/filtering ), although the best way to do it will depend on the trigger you are using for the filter I think. It is certainly possible to disable the regex that DataTables uses and put in your own - which you can do if you want ( http://datatables.net/usage/options#oSearch ) so you could do '^Okay$', but then you lose the "smart filtering".

    The easiest way with a custom filter is to use a type based filer and have it do something with the string when your filtering selection changes. Probably not completely trivial, but it should be do able :-)

    Allan
  • tiitremmeltiitremmel Posts: 5Questions: 0Answers: 0
    Thanks, you gave me a great idea!
This discussion has been closed.