How to display datatable rows with a selected row from another Datatable
How to display datatable rows with a selected row from another Datatable
Divikiran
Posts: 5Questions: 0Answers: 0
Hi All,
I am trying to display a datatable with the selection of row from another datatable. it works for first selection though.
I have tried below
function loadPersonelDetails(aData) {
//Profile Name
$("#tbName").val(aData.PermissionProfile.ProfileName);
//Profile Description
$("#tbDescription").val(aData.PermissionProfile.ProfileDesc);
//Profile ID (Hidden)
$("#cphContent_hdnPermissionProfileID").val(aData.PermissionProfile.PermissionProfileID);
//tbID
$("#tbID").val(aData.PermissionProfile.PermissionProfileID);
}
//On Selction : Load Data on page
$('#PermissionProfileTable tbody tr').live('click', function (event) {
var aData = oTable.fnGetData(this); // get datarow
loadPersonelDetails(aData);
});
when we select the next row or selection to show relevant data in second datatable it's working.
basically second datatable is not reinitializing again.
Any workaround or alternate solutions.
Thanks in advance
Divikiran
I am trying to display a datatable with the selection of row from another datatable. it works for first selection though.
I have tried below
function loadPersonelDetails(aData) {
//Profile Name
$("#tbName").val(aData.PermissionProfile.ProfileName);
//Profile Description
$("#tbDescription").val(aData.PermissionProfile.ProfileDesc);
//Profile ID (Hidden)
$("#cphContent_hdnPermissionProfileID").val(aData.PermissionProfile.PermissionProfileID);
//tbID
$("#tbID").val(aData.PermissionProfile.PermissionProfileID);
}
//On Selction : Load Data on page
$('#PermissionProfileTable tbody tr').live('click', function (event) {
var aData = oTable.fnGetData(this); // get datarow
loadPersonelDetails(aData);
});
when we select the next row or selection to show relevant data in second datatable it's working.
basically second datatable is not reinitializing again.
Any workaround or alternate solutions.
Thanks in advance
Divikiran
This discussion has been closed.
Replies
$('#PermissionProfileTable tbody tr').live('click', function (event) {
$(this).toggleClass('row_selected');
var aData = oTable.fnGetData(this); // get datarow
loadPersonelDetails(aData);
});
causeing 'this' data to be replaced with new datatable 'this' data
I need way to select a row information from the datatable1 to pass them as parameters to second datatable.
This works fine for first time, but second time it fails.
"var aData = oTable.fnGetData(this)" normally does the job, but when second table comes and overwrites 'this' with its information.
is there any other means to achive node information (this out using 'this')
The way I would suggest doing it is to use fnClearTable and then fnAddData to clear the old data from the table and then insert your new data.
Allan