//
// Function to load dynamic data into a div named "dynamic-table-div" using ajax.DataTable.Fetch.php
//
function loadDynamicData(table_name,action,sequence_flag,table_id,data_div,custom_data,oncomplete_func) {
var screenDiv = "dynamic-table-div";
if (data_div.length > 0) screenDiv = data_div;
$("#"+screenDiv).html("
Loading...
");
$("#"+screenDiv).html("
");
// Format parameters
var data = "table_name="+table_name+
"&sequence_flag="+sequence_flag+
"&action="+action+
"&table_id="+table_id+
custom_data;
// Get data table
$.ajax({
type: "GET",
url: "ajax.DataTable.Fetch.php",
contentType: "application/x-www-form-urlencoded; charset=utf-8",
dataType: "json",
data: data,
success: function(results) {
$("#"+screenDiv).html(results.content);
if ($('.top-insert-button') && results.num_records > 10) $('.top-insert-button').show();
if (sequence_flag == 'Y') {
$("#"+table_id).tableDnD({
onDrop: function(table, row) {
var rows = table.tBodies[0].rows;
var data = "&table="+table_name;
for (var i=0; i