Accessing contents of hidden column
Accessing contents of hidden column
Firstly, datatables is fantastic and I'm using it a lot lately. Thanks for your efforts.
I'm using the context menu plugin (http://abeautifulsite.net/blog/2008/09/jquery-context-menu-plugin/) to give me some menu options when I right click on a row.
I'm having difficulty storing a unique ID on each row, that I can access with my context menu. I've managed to do this previously by putting the unique ID in a REL attribute of a link within a TD within the row, but in this instance i want the context menu to work across the whole row and I've applied a class to the row using :
[code]"fnRowCallback": function( nRow, aData, iDisplayIndex )
{
$(nRow).addClass('noteMenuTrigger');
return nRow;
}[/code]
I've generating my table using JSON/AJAX and I thought that I could store the uniqueID for my table in the first TD of the row then hide it. The context menu plugin provides the element that was clicked as "el" and if I use [code] rowid = $('td:first',el).html();[/code] I can access my unique row id from the database table, but as soon as I set [code]{ "bVisible": false }[/code] this renders that data inaccessible.
How can I access this invisible data, or can you recommend an alternative way of storing unique row data somewhere in the row that I can access.
I'm using the context menu plugin (http://abeautifulsite.net/blog/2008/09/jquery-context-menu-plugin/) to give me some menu options when I right click on a row.
I'm having difficulty storing a unique ID on each row, that I can access with my context menu. I've managed to do this previously by putting the unique ID in a REL attribute of a link within a TD within the row, but in this instance i want the context menu to work across the whole row and I've applied a class to the row using :
[code]"fnRowCallback": function( nRow, aData, iDisplayIndex )
{
$(nRow).addClass('noteMenuTrigger');
return nRow;
}[/code]
I've generating my table using JSON/AJAX and I thought that I could store the uniqueID for my table in the first TD of the row then hide it. The context menu plugin provides the element that was clicked as "el" and if I use [code] rowid = $('td:first',el).html();[/code] I can access my unique row id from the database table, but as soon as I set [code]{ "bVisible": false }[/code] this renders that data inaccessible.
How can I access this invisible data, or can you recommend an alternative way of storing unique row data somewhere in the row that I can access.
This discussion has been closed.
Replies
[code]
console.log(oTable.fnGetData( 0 )[4]);
[/code]
hey Allan, your API says funGetData(iRow, iCol) should work, but I'm getting errors unless I omit the column
@fbas: Thanks for the heads up! I'll check that out and correct to the way I originally intended (which I forget at the moment...).
Regards,
Allan