fnGetSelectedData applied to visible only?
fnGetSelectedData applied to visible only?
hozt
Posts: 45Questions: 0Answers: 0
Hello,
Since the way TableTools 'multi row' selection is [ binded to table only ]* I decided it makes no sense to have two different type of selections, I am now using TTools selection, for my 'mass' actions. Such as 'Delete All'.
* I have managed to use the checkboxes in my action column to select and deselect through them, ignoring clicks on the row itself.
* Allan I think you should consider a feature like this. Outside 'selecting' - or not limited to row. Not what I came here for anyway!
I managed to do it (the Delete All ie) with with no problem with the API function: fnGetSelectedData
But I need something else, I couldn't find it in the API but is there a way to get the visible data only?
I know the plugin itself has access and can gather only those rows, since if we 'Select All' and filter after, he only copys to the clipboard what is visible, according to my definition.
But I would also like to apply actions only to the visible rows, some function like 'SelectedVisibleData' would be EPIC. Unless there is already a way.
Anyhow, I would appreciate anyone idea on how to do this. "Hacking" into the plugin if it has to be.
Thanks in advance.
Since the way TableTools 'multi row' selection is [ binded to table only ]* I decided it makes no sense to have two different type of selections, I am now using TTools selection, for my 'mass' actions. Such as 'Delete All'.
* I have managed to use the checkboxes in my action column to select and deselect through them, ignoring clicks on the row itself.
* Allan I think you should consider a feature like this. Outside 'selecting' - or not limited to row. Not what I came here for anyway!
I managed to do it (the Delete All ie) with with no problem with the API function: fnGetSelectedData
But I need something else, I couldn't find it in the API but is there a way to get the visible data only?
I know the plugin itself has access and can gather only those rows, since if we 'Select All' and filter after, he only copys to the clipboard what is visible, according to my definition.
But I would also like to apply actions only to the visible rows, some function like 'SelectedVisibleData' would be EPIC. Unless there is already a way.
Anyhow, I would appreciate anyone idea on how to do this. "Hacking" into the plugin if it has to be.
Thanks in advance.
This discussion has been closed.
Replies
Allan, I just replied an old topic with a similar issue I found here ( http://datatables.net/forums/discussion/comment/32691#Comment_32691 )
Although this isn't my preferred solution (preferred option in 1st post), I would be happy if it worked.
I'm using this code
[code]
var oTT = TableTools.fnGetInstance('my_table');
var rVis = oTable.fnGetDisplayNodes();
for (var i=0; i
Allan, I just replied an old topic with a similar issue I found here ( http://datatables.net/forums/discussion/comment/32691#Comment_32691 )
Although this isn't my preferred solution (preferred option in 1st post), I would be happy if it worked.
I'm using this code
[code]
var oTT = TableTools.fnGetInstance('my_table');
var rVis = oTable.fnGetDisplayNodes();
for (var i=0; i
Figured it out.
The problem:
$(rVis[i]).click() -> yes.
oTT.fnDeselect ( rVis[i] ) -> no $ on rVis -.-
Obviously, although I'm only using the oTT.isSelected, since .click() is faster than selecting and deselecting through TableTools (apparently).
EDIT:
.click() Doesn't work on WebKit browsers. (Safari and Chrome).
Back to fnSelect and fnDeselect :D