Hi all,
Please see here for test case:
http://live.datatables.net/enopeg/5/edit
I have registered an extension to filter results by distance from a specific latitude and longitude. The filter is unfortunately filtering incorrect results (as can be seen by the console.logs). If I use aData (for longitude and latitude) there is no problem, though the actual data is stored in the tr's data attributes data-lon and data-lat. With that in mind I decided to use the datatables jquery selector based on the iDataIndex (that I presumed was the index of the row being filtered). As you can see in the console logs the actual filtered item does not match the $.eq(iDataIndex) of the row in the table.
Brief explanation of the console.logs:
The aData[0] content : Another School
The $.eq(iDataIndex) content of first column : Lord Lawson of Beamish Community School
Distance in miles from start lat/lng : 241.49194047201945
Return value from filter : false
As you can see above aData[0] does not correspond with the jquery selection that I've made using the iDataIndex and as a result filters the wrong row.
Am I doing something wrong here or have i misinterpreted the iDataIndex argument of the filter?
Some assistance or clarification would be wonderful.
Many thanks
jQuery : 1.9.1
Datatables : 1.9.4
Please see here for test case:
http://live.datatables.net/enopeg/5/edit
I have registered an extension to filter results by distance from a specific latitude and longitude. The filter is unfortunately filtering incorrect results (as can be seen by the console.logs). If I use aData (for longitude and latitude) there is no problem, though the actual data is stored in the tr's data attributes data-lon and data-lat. With that in mind I decided to use the datatables jquery selector based on the iDataIndex (that I presumed was the index of the row being filtered). As you can see in the console logs the actual filtered item does not match the $.eq(iDataIndex) of the row in the table.
Brief explanation of the console.logs:
The aData[0] content : Another School
The $.eq(iDataIndex) content of first column : Lord Lawson of Beamish Community School
Distance in miles from start lat/lng : 241.49194047201945
Return value from filter : false
As you can see above aData[0] does not correspond with the jquery selection that I've made using the iDataIndex and as a result filters the wrong row.
Am I doing something wrong here or have i misinterpreted the iDataIndex argument of the filter?
Some assistance or clarification would be wonderful.
Many thanks
jQuery : 1.9.1
Datatables : 1.9.4