fnUpdate not triggering fnRender causes TypeError in _fnDataToSearch

fnUpdate not triggering fnRender causes TypeError in _fnDataToSearch

thiloginkelthiloginkel Posts: 2Questions: 0Answers: 0
edited June 2012 in Bug reports
I have a table that declares a fnRender function for one column to transform an array into a string. This works fine when initially adding the data using fnAddData (where fnRender is called correctly), but fails when updating data at a later point in time using fnUpdate (for a complete row) where fnRender is apparently not being called, but the array is supplied to _fnDataToSearch as sData on which sData.replace(/[\r\n]/g," ").replace( /<.*?>/g, "" ) is invoked, which fails as an array has no replace method.

Stack trace:

[code]
Uncaught TypeError: Object xxx has no method 'replace' jquery.dataTables.js:2327
_fnDataToSearch jquery.dataTables.js:2327
_fnBuildSearchRow jquery.dataTables.js:2261
DataTable.fnUpdate jquery.dataTables.js:6023
DataTable.fnUpdate jquery.dataTables.js:5992
DataTablesView.changeOne data_tables_view.js:52
...
[/code]

Example data that is passed to fnUpdate:

[code]
{"id":14,"name":"Test","nodes":["xxx"],"version":8}
[/code]

DataTables v1.9.2, debug code: obuveg

Any ideas?

Replies

  • thiloginkelthiloginkel Posts: 2Questions: 0Answers: 0
    If you see no chance of addressing this bug (or incorrect usage?) for free, please let me know and we can certainly talk about doing this under a paid support agreement. ;-)
  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    Hi,

    Sorry for the delay in getting back to you - an overwhelming number of posts in the forum at the moment!

    Great question - here is one in return :-). How are you calling fnUpdate? Is it with both the row and the column specified (i.e. you are updating a cell)?

    I've actually made a change in fnUpdate in the last day or two to better handle arrays an objects - I wonder if you could install the current 1.9.3.dev nightly ( http://datatables.net/download ) and try it with that?

    Many thanks,
    Allan
This discussion has been closed.