on click on link i am showing Datatable..............

on click on link i am showing Datatable..............

sharadneo1sharadneo1 Posts: 16Questions: 1Answers: 0
edited July 2013 in DataTables 1.9
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": 'View values'

},

{
"mData": null,
"sClass": "right",
"sDefaultContent": '  '

}

],

"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
This discussion has been closed.