ColumnFilterWidgets with JSON-data

ColumnFilterWidgets with JSON-data

mbaasmbaas Posts: 61Questions: 22Answers: 1
edited March 2014 in Plug-ins

I have managed to successfully migrate my 8.000-table row from HTML to JSON-data which has quite nicely boosted performance :-)
Now, one of the few remaining probs is when using ColumnFilterWidgets, it seems to use the plain json-data, not the data which my mRender-function returns. How can I feed "prepared" data into CFW?




  • allanallan Posts: 55,114Questions: 1Answers: 8,654 Site admin
    Hi Michael,

    I think you would need to modify the ColumnFilterWidgets code. I'm not particularly familiar with that plug-in, but I know it uses the fnGetColumnData plug-in API method - that gets the raw data for the column - as you say, unformatted.

    Using DataTables 1.10 the `column().cache()` method ( ) could be used to get the data that DataTables is going to use for the column's filtering. So fnGetColumnData in ColumnFilterWidgets would basically be replaced with a call such as `table.column().cache( 'search' )` . This of course is dependent upon 1.10 - there isn't a method in 1.9 to get this stored information...

    Long and short of it is, it would need an update to the plug-in.

  • mbaasmbaas Posts: 61Questions: 22Answers: 1
    Ouch - I'll wait for 1.10 then and pass the required data to my json-source. (I wanted to save a few bytes by sending numeric codes instead of strings...)
This discussion has been closed.