Hi,
I'm new so maybe I'm doing something terrible wrong :=)
But the problem is that the grid shows the data from the previusly loaded data.
Flow: Selects a database, fetches data from that db's table. Generate html table. The table shows the right data, but the converted grid is wrong.
Please se code below. The load fetches a generated table.
$("#databases").dblclick(function() {
var input = $("#databases").val();;
if(input != db)
db = $("#databases").val();
else
return;
var dbstring = 'fieldmappings.php?dbname=' + db;
$('#fortune').load(dbstring);
tbl = $("#fortune");
obj = $.paramquery.tableToArray(tbl);
if(newObj == null)
{
newObj = { width: 1000, height: 800, title: "ONREGFieldMappings " + db, resizable: true };
newObj.dataModel = { data: obj.data, rPP: 50, paging: "local" };
newObj.colModel = obj.colModel;
$("#grid_table").pqGrid(newObj);
$("#grid_table").pqGrid("option", "scrollModel", { horizontal: $(this).is(":checked") });
}
else {
$("#grid_table").pqGrid( "destroy" );
newObj = { width: 1000, height: 800, title: "ONREGFieldMappings " + db, resizable: true };
newObj.dataModel = { data: obj.data, rPP: 50, paging: "local" };
newObj.colModel = obj.colModel;
$("#grid_table").pqGrid(newObj);
$("#grid_table").pqGrid("option", "scrollModel", { horizontal: $(this).is(":checked") });
}