How can i reload the new ajax
How can i reload the new ajax
Namrata
Posts: 6Questions: 0Answers: 0
I have dynamic sAjaxSource, i want to load new ajax file in same datatable. How can i do that? My code is,
function loadtabledata1(tableID, fileId, columnInfo){
oTable = $('#'+tableID).dataTable({
"bFilter": false,
"bInfo": false,
"bLengthChange": false,
"bPaginate": false,
"aoColumns": columnInfo, // Column names
"bProcessing": true, // Enable or disable the display of a 'processing' indicator when the table is being processed
"sAjaxSource": 'ajax/accordData_'+fileId+'.json',
"bRetrieve": true,
"fnServerData": function ( sSource, aoData, fnCallback ) {
/* Add some extra data to the sender */
aoData.push({"name":"customerId", "value":$('#customerId option:selected').val()});
aoData.push({"name":"contractId", "value":$('#contractId option:selected').val() });
aoData.push({"name":"allCases", "value":$('#allCases option:selected').val() });
aoData.push({"name":"parentId", "value":$('input.parentId').val() });
aoData.push({"name":"caseId", "value":$('input.caseId').val() });
aoData.push({"name":"customerReference", "value":$('input.customerReference').val()});
aoData.push({"name":"locationAccountId", "value":$('input.locationAccountId').val()});
aoData.push({"name":"title", "value":$('input.title').val() });
aoData.push({"name":"siteId", "value":$('#siteId option:selected').val()});
aoData.push({"name":"elementOrServiceType", "value":$('#elementOrServiceType option:selected').val() });
aoData.push({"name":"clientAddress", "value":$('input.clientAddress').val() });
//aoData.push({"name":"escalationLevel", "value":"ANY" });
aoData.push({"name":"escalationLevel", "value":$('#escalationLevel option:selected').val() });
aoData.push({"name":"elementId", "value":$('#elementId option:selected').val() });
aoData.push({"name":"serviceImpact", "value":$('#serviceImpact option:selected').val() });
aoData.push({"name":"status", "value":$('#status option:selected').val() });
aoData.push({"name":"date_from", "value":$('#input.date_from').val() });
aoData.push({"name":"date_to", "value":$('#input.date_to').val() });
$.getJSON( sSource, aoData, function (json) {
fnCallback(json);
});
},
"bDestroy":true,
});// datatable closed
// For Tooltips
/* oTable = $('#'+tableID).dataTable();
oTable.fnClearTable(0);
oTable.fnDraw(); */
}
function loadtabledata1(tableID, fileId, columnInfo){
oTable = $('#'+tableID).dataTable({
"bFilter": false,
"bInfo": false,
"bLengthChange": false,
"bPaginate": false,
"aoColumns": columnInfo, // Column names
"bProcessing": true, // Enable or disable the display of a 'processing' indicator when the table is being processed
"sAjaxSource": 'ajax/accordData_'+fileId+'.json',
"bRetrieve": true,
"fnServerData": function ( sSource, aoData, fnCallback ) {
/* Add some extra data to the sender */
aoData.push({"name":"customerId", "value":$('#customerId option:selected').val()});
aoData.push({"name":"contractId", "value":$('#contractId option:selected').val() });
aoData.push({"name":"allCases", "value":$('#allCases option:selected').val() });
aoData.push({"name":"parentId", "value":$('input.parentId').val() });
aoData.push({"name":"caseId", "value":$('input.caseId').val() });
aoData.push({"name":"customerReference", "value":$('input.customerReference').val()});
aoData.push({"name":"locationAccountId", "value":$('input.locationAccountId').val()});
aoData.push({"name":"title", "value":$('input.title').val() });
aoData.push({"name":"siteId", "value":$('#siteId option:selected').val()});
aoData.push({"name":"elementOrServiceType", "value":$('#elementOrServiceType option:selected').val() });
aoData.push({"name":"clientAddress", "value":$('input.clientAddress').val() });
//aoData.push({"name":"escalationLevel", "value":"ANY" });
aoData.push({"name":"escalationLevel", "value":$('#escalationLevel option:selected').val() });
aoData.push({"name":"elementId", "value":$('#elementId option:selected').val() });
aoData.push({"name":"serviceImpact", "value":$('#serviceImpact option:selected').val() });
aoData.push({"name":"status", "value":$('#status option:selected').val() });
aoData.push({"name":"date_from", "value":$('#input.date_from').val() });
aoData.push({"name":"date_to", "value":$('#input.date_to').val() });
$.getJSON( sSource, aoData, function (json) {
fnCallback(json);
});
},
"bDestroy":true,
});// datatable closed
// For Tooltips
/* oTable = $('#'+tableID).dataTable();
oTable.fnClearTable(0);
oTable.fnDraw(); */
}
This discussion has been closed.