Hi Allen,
I have given one link in ist data table, and on select of that link i am sending id getting some data and showing inside of one more data table.
But the problem is that old data is showing for mean time , finally the correct data is coming only... in 2nd table...
my code is................................
Ist table
..................
definedTypeTable = $("#definedType").dataTable({
"sPaginationType" : "scrolling",
"bProcesing" : true,
"bServerSide" : true,
"bLenthChange" : false,
"iDisplayLength" : 10,
"sScrollY" : "300px",
"sAjaxSource" : "/ECE/getDefinedTypes",
"bSort" : false,
"bFilter" : false,
"aoColumns" : [
{
"bVisible": false,
"mData" : "defTypeID",
},
{
"sTitle" : "Description",
"mData" : "defTypeDesc"
},
{
"sTitle" : "Domain Text",
"mData" : "defTypeText"
},
{
"mData": null,
"sClass": "left",
"sDefaultContent": '<a href="" class="show">View values</a>'
},
{
"mData": null,
"sClass": "right",
"sDefaultContent": '<a href="" class="edit"><img src="images/editnode.JPG" /></a> <a href="" class="editor_remove"><img src="images/delete.png" /></a>'
}
],
"fnServerData" : function(sSource, aoData, fnCallback) {
$.ajax({
"dataType" : 'json',
"type" : "GET",
"url" : sSource,
"data" : aoData,
"success" : function(json)
{
fnCallback(json);
}
});
},
"sPaginationType" : "full_numbers"
});
2nd table
..................
$('#definedType').on('click', 'a.show', function (e){
var sData = definedTypeTable.fnGetData($(this).parents('tr')[0]);
var defTypeID = sData['defTypeID'];
// DataTables init
definedTypeValueTable = $("#definedTypeValue").dataTable({
"sPaginationType": "scrolling",
"bProcesing" : true,
"bServerSide" : true,
"bLenthChange" : false,
"iDisplayLength" : 10,
"sScrollY" : "200px",
"sAjaxSource" : '/ECE/getDefTypValuesById?defTypeID='+defTypeID,
"bDestroy" : true,
"bSort" : false,
"bFilter" : false,
"aoColumns" : [
{
"sTitle" : "Data Type",
"mData" : "defTypeID",
"bVisible": false
},
{
"sTitle" : "Number",
"mData" : "itemID"
},
{
"sTitle" : "Name",
"mData" : "defTypeValDesc"
},
],
"fnServerData" : function(sSource, aoData, fnCallback) {
$.ajax({
"dataType" : 'json',
"type" : "GET",
"url" : sSource,
"data" : aoData,
"success" : function(json)
{
fnCallback(json);
}
});
},
"sPaginationType" : "full_numbers"
});
return false;
});
Thanks In Advance