1.9.4 to 1.10 upgrade lost feature

1.9.4 to 1.10 upgrade lost feature

jameskitejameskite Posts: 7Questions: 2Answers: 0
edited July 2014 in Free community support

I'm in the process of an upgrade and noticed that I can no longer set a name for column data (columns.data, previously aoColumns.mData) for HTML data source. Initialization with data property set results in an 'unknown parameter error'.
I do it this way because I then at some point after initialization, usually when the data has been modified I do an ajax reload.

Is this sort of thing still possible?
Thanks

This question has an accepted answers - jump to answer

Answers

  • DaimianDaimian Posts: 62Questions: 1Answers: 15

    This isn't a solution to the problem, but may help with avoiding the issue....

    If your doing an AJAX reload later, why not just load the initial data via AJAX? This would improve page loading performance and simplify the overall page design.. remember to always follow the KISS principle.

  • jameskitejameskite Posts: 7Questions: 2Answers: 0
    edited July 2014

    The data is < table > into the page anyway when the page is first retrieved. The additional request for data again would be a waste.
    There is very little development overhead for this.

    At the moment I just have it making the additional request in testing, I am hoping this can be resolved before deployment in a couple of weeks.

  • DaimianDaimian Posts: 62Questions: 1Answers: 15

    It doesn't appear what you desire will work with Datatables 1.10.

    Sorry but you will likely have to downgrade or alter your design.

  • jameskitejameskite Posts: 7Questions: 2Answers: 0

    Are any developers interested in reinstating this feature? Its not too niche is it?

  • jameskitejameskite Posts: 7Questions: 2Answers: 0

    Shameless bump so Allan might see this... :)

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin
    Answer ✓

    I must admit, I didn't know 1.9 did that! It wasn't intentional and actually I'm thinking of it as a bug rather than a feature :-).

    A proper fix for this would be the ability to change the data source for a column after initialisation. That probably isn't too hard to do with a plug-in and ripping out some of the code from the DataTables core. The difficulty there is that your existing data will need to be wiped and added using the new format.

    The reason for this is that the data is read from the DOM as an array, but you want to use objects.

    There is actually another fix, one which I think I prefer, which is to have the data read into an object from the DOM, rather than into an array - then everything can carry on, and you've got a wonderful, easy to use object, rather than a nasty array...

    Its a feature that I've thought of before, but haven't really been planning to implement. I've added an investigation to what would be involved to my to do list now though as I suspect it wouldn't be that hard to do and could be quite useful. Can't say when I'll get to it just at the moment, as my to do list is rather long I'm afraid, but its a good plan I think!

    Allan

  • jameskitejameskite Posts: 7Questions: 2Answers: 0

    Ok thanks Allan, really appreciate the response. I'll look at adjusting the way I do things in the interrim.

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin

    I've added this ability here. it will be in the soon to be released 1.10.3 :-)

    Allan

This discussion has been closed.