fnFindCellRowIndexes not working...

fnFindCellRowIndexes not working...

TimmoTimmo Posts: 3Questions: 0Answers: 0
edited January 2014 in Plug-ins
It looks like this was not working due to aData transitioning from being an array to an object at some stage.

Following code appears to correct this: ( old code in comment to the side).

[quote] for (var field in aData ) [/quote]

replaces

[quote] ( j=0, jLen=aData.length ; j

Replies

  • allanallan Posts: 57,686Questions: 1Answers: 9,195 Site admin
    Fantastic - thanks for pointing that out. I've just updated the plug-ins to use `fnGetData` which is the correct way to do it in 1.9. The commit is here: https://github.com/DataTables/Plugins/commit/f3e99a6 .

    They won't be updated on this site just yet and I'm in the middle of rewriting components of it, such as the plug-ins.

    Been thinking that I might include the ability to search by data in 1.10's selectors... not quite decided yet. Will probably come down to how small I can make the code for it, but it is a useful feature I think.

    Allan
  • TimmoTimmo Posts: 3Questions: 0Answers: 0
    Thanks Allan that's great!

    I was originally going to use it to find my row by its ID but then discovered DT_RowId which solved my problem. I can certainly foresee contexts in the future where I will put this feature to use tho. Valuable for any context where I might want to perform an action on any rows matching a certain criteria, such as a multi-row delete or update.

    Cheers,
    Tim
  • TimmoTimmo Posts: 3Questions: 0Answers: 0
    Reflecting on my own comment above, I can't imagine why I wouldn't ask the database to do that for me and return the ID's, which somewhat counts against the value of adding that search feature. Maybe the only value is in building a body of data client side before submitting, similar to the ember.js kind of paradigm. Personally I don't like it... although I'm slowly trusting DOM more as I learn more about it, and have a little more confidence in what I have done to it!

    Would be curious to here your thoughts on this Allan - how do you see DataTables interacting with various frameworks, or do you prefer to remain as agnostic as possible in that sense? (feel free to post a link and close if this has come up before!)
  • allanallan Posts: 57,686Questions: 1Answers: 9,195 Site admin
    > how do you see DataTables interacting with various frameworks, or do you prefer to remain as agnostic as possible in that sense?

    I would like to see DataTables interfacing with frameworks more, but it must remain as agnostic as possible - I'm not willing to have any dependencies for DataTables other than jQuery :-). The approach taken with the themeing of DataTables is how I would like to interface with other libraries - i.e. with plug-ins that extend DataTables for a specific use case (Bootstrap, Foundation etc).

    I'm slowly doing some work with Knockout and DataTables in that regard, and all input from yourself or anyone else for that or other frameworks is very welcome. We've all got our favourite frameworks! (although admittedly as a library author I suffer from a strong case of "I'll just roll my own...")

    Allan
This discussion has been closed.