Row level functionality
Row level functionality
Hello,
Is their a way where i can bind an Id with row in datatables?
I get 3 columns from my database and display 2 in datatable to user, but what i want is to attach 1th column (which is Id) to whole row so that when user clicks on a particular row, it takes user to different page depending on Id.
ex
[code]
"aoColumns": [
{ "mData": "Id",
"bSearchable": false,
"bSortable": false,
//"bVisible": false,
"fnRender": function (oObj) {
return 'Id';
}
},
{ "mData": "FullName" },
{ "mData": "Age" }
]
[/code]
and this is what i get in Json
[code]{"sEcho":"1","iTotalRecords":1,"iTotalDisplayRecords":1,"aaData":[{"Id":425,"FullName":"xxx","Age":21,}]}[/code]
also oObj.aData[0] always comes out as undefined? i am showing FullName and Age but want user to click on row level.
Any help will be appreciated
Thanks
Is their a way where i can bind an Id with row in datatables?
I get 3 columns from my database and display 2 in datatable to user, but what i want is to attach 1th column (which is Id) to whole row so that when user clicks on a particular row, it takes user to different page depending on Id.
ex
[code]
"aoColumns": [
{ "mData": "Id",
"bSearchable": false,
"bSortable": false,
//"bVisible": false,
"fnRender": function (oObj) {
return 'Id';
}
},
{ "mData": "FullName" },
{ "mData": "Age" }
]
[/code]
and this is what i get in Json
[code]{"sEcho":"1","iTotalRecords":1,"iTotalDisplayRecords":1,"aaData":[{"Id":425,"FullName":"xxx","Age":21,}]}[/code]
also oObj.aData[0] always comes out as undefined? i am showing FullName and Age but want user to click on row level.
Any help will be appreciated
Thanks
This discussion has been closed.
Replies
The 'magic' data source parameter name of `DT_RowId` will be used for the row id if it is found. `DT_RowClass` is the other one. The other option is to use fnCreatedRow and assign the id manually.
Allan