using mRender, how can I give radio buttons unique name per row?
using mRender, how can I give radio buttons unique name per row?
rolfsf
Posts: 27Questions: 6Answers: 0
Very simply, I'm building a table dynamically (as well as adding/removing rows dynamically), and each row will contain 4 columns. Three of the columns will be radio buttons. To function properly I need to give each row's set of radio buttons a unique name ... e.g.
I can't figure out how to get that unique number for the name within mRender... whether it's the rowIndex or some other internal dataTable reference.
right now, my mRender looks like this:
[code]
aTargets: [1,2,3],
mData: null,
mRender: function (data, type, full) {
if (type == 'display') {
return '';
}
return data;
}
[/code]
Any advice?
Thanks!
I can't figure out how to get that unique number for the name within mRender... whether it's the rowIndex or some other internal dataTable reference.
right now, my mRender looks like this:
[code]
aTargets: [1,2,3],
mData: null,
mRender: function (data, type, full) {
if (type == 'display') {
return '';
}
return data;
}
[/code]
Any advice?
Thanks!
This discussion has been closed.
Replies
Allan
thanks Allan... I'll keep tinkering for a while
Allan
As I mentioned elsewhere, this is a major oversight on the part of the DataTables development team. The oObj argument to fnRender() had everything one would need to get access to the inner workings of the DataTable, including accessing aoColumnDefs / aoColumns to find a column index for a specific column name, joining in data from other columns (first name / last name concatenation), line numbering (Sales Order, Purchase Order details entry), dynamically rendering cells as editable or not editable, unlimited uses. Not having access to the oObj object in mData() and mRender() is a show-stopper for upgrading to DataTables 1.10. Even doing simple things such as numbering rows (oObj.iDataRow) is now impossible using mRender().
Please either provide oObj as a fourth parameter to mData() / mRender(), or put fnRender() / bUseRendered functionality back. Preferably both. It seems as if you could add oObj as a fourth argument to mData() / mRender(), and then write a migration plugin (a la jquery-migration) which provides the missing fnRender() functionality by hooking mData() or mRender() (mData() if bUseRendered is true; mRender() if it's false).
How quickly can we get this very important functionality restored?
Thanks for the feedback. i've replied to your other comment on this topic here.
Allan