fnFilter and hidden columns

fnFilter and hidden columns

uibobituibobit Posts: 2Questions: 0Answers: 0
edited February 2012 in General
Hi,

I'm using 1.9 and following the instructions from http://datatables.net/release-datatables/examples/api/multi_filter.html. The only little hitch I have is how to work with hidden columns. My first column is a timestamp for a transaction, and the users don't need to see that. So I set bVisible: false. Perfect. But then the input field in the first visible column actually filters on the invisible column. I've tried various permutations, and can't get it to work.

This is the column layout from the database(simplified):
[code]
"aoColumnDefs": [
{ "sTitle": "Time Stamp", "bVisible":false, "aTargets": [0], "mDataProp":"mytimestamp"},
{ "sTitle": "ID", "sWidth": "150pt", "aTargets": [1], "mDataProp":"id"},
{ "sTitle": "Hours", "sWidth": "120pt", "aTargets": [2], "mDataProp":"hours"},
{ "sTitle": "UID", "bVisible":false, "aTargets": [3], "mDataProp":"uid"},
{ "sTitle": "Description", "sWidth": "320pt", "aTargets": [4], "mDataProp":"description"},
]
[/code]

Since ID is the first visible column in the table, it's input tag is [0] in the asInitVals array when the code iterates through the inputs in the footer. But ID is really [1] in the columns.

It might work if I put in some fake invisible input elements outside of the th, but that seems really bad form. Any ideas?

Thanks,


Bob
This discussion has been closed.