fnGetData return inconsistent error message

fnGetData return inconsistent error message

matmat83matmat83 Posts: 1Questions: 0Answers: 0
edited July 2013 in General
Hi,

I know this is not a big deal but when you use the [code]fnGetData[/code] method, giving a jQuery object instead of a simple HTMLElement object (the TR node) the method will throw an exception which is not very relevant : "Uncaught TypeError: Cannot call method 'toLowerCase' of undefined". I think it could be a good think to add a test for jQuery object (and eventually retrieve the first element [0] in the case of .length > 0). At the same time, it could be a good think to manage an more relevant error message. What do you think ..?

Regards,

Mat

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    fnGetData expects a node, as noted in the documentation, rather than a jQuery object. However, I know this is quite annoying and the new API in 1.10 will support jQuery objects (and selectors) just as much as nodes :-). For example you'll be able to do `table.row( $('#whatever') ).data()` (you'll also be able to just do `table.row( '#whatever' ).data()` .

    This is already available in the 1.10 WIP branch on github if you want to try it out, but there is no documentation for 1.10's API yet (hence why its not been released...).

    Allan
This discussion has been closed.