ColumnFilter "select" bug
ColumnFilter "select" bug
Hello,
This plug-in obviously would save me lots of work, I figure it has some bug due to what's happening, I've been going around this for a couple of days now, and can't seem to find a reason.
What i have is ajax-source loading and I'm using aoColumns with mDataProp to say what goes where.
Then I just load columnFilter, worked fine, 'till i went and decided I wanted a 'select' field.
It doesn't fill the select, and pops this error:
"sValue is undefined"
At line 77 of the plug-in:
"if (bIgnoreEmpty == true && sValue.length == 0) continue;"
Any ideas and help would be very much appreciated! If Mr. Allan himself sorts me out, I'll donate another couple of beers.
The Plug-in: http://jquery-datatables-column-filter.googlecode.com/svn/trunk/ajaxSource.html
The test-case: http://andrecatita.com/databug/tarifarios.htm
This plug-in obviously would save me lots of work, I figure it has some bug due to what's happening, I've been going around this for a couple of days now, and can't seem to find a reason.
What i have is ajax-source loading and I'm using aoColumns with mDataProp to say what goes where.
Then I just load columnFilter, worked fine, 'till i went and decided I wanted a 'select' field.
It doesn't fill the select, and pops this error:
"sValue is undefined"
At line 77 of the plug-in:
"if (bIgnoreEmpty == true && sValue.length == 0) continue;"
Any ideas and help would be very much appreciated! If Mr. Allan himself sorts me out, I'll donate another couple of beers.
The Plug-in: http://jquery-datatables-column-filter.googlecode.com/svn/trunk/ajaxSource.html
The test-case: http://andrecatita.com/databug/tarifarios.htm
This discussion has been closed.
Replies
I'm just hitting a wall.
What i found is that, if I don't use sAjaxSource but copy my previously loaded into the table with he results. And just initialize datatable with columnfilter, it will appear then the select's.
But, on the plug-in page it seems to be working with sAjaxSource, but not on my case.
Did another test:
when my aaData is filled with 'associative' arrays that I bind with mDataProp (it pops that error)
Example:
[code]
"aaData": [
{
"DT_RowId": "1",
"nome": "zzzzz",
"data": "0000-00-00"
}
][/code]
When it is like this:
[code]
"aaData": [
[
"1",
"zzzzz",
"0000-00-00"
]
]
[/code]
It works!! But i need it like the first case.
So it's either mDataProp or being an associative array that's the problem. Can't seem to figure it out from looking into the plug-in, would appreciate anyone who could tho.
What to do is to replace these two lines in the plug-in:
[code]
var aData = this.fnGetData(iRow);
var sValue = aData[iColumn];
[/code]
with:
[code]
var sValue = this.fnGetData(iRow, iColumn);
[/code]
and that should do it.
I've updated the plug-in on the plug-ins page, and I'll open an issue against the column filtering plug-in.
Allan
Little fix on your code: this has to be oTable
[code]var sValue = oTable.fnGetData(iRow, iColumn);[/code]
Your awesome, period.
Good to hear that does the job for you.
Allan