1
Help for ParamQuery Grid (free version) / Re: Switch tables from database
« on: February 18, 2014, 05:50:07 pm »
Thank you very much, works like a beuty
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
$("#databases").dblclick(function() {
var input = $("#databases").val();;
if(input != db)
db = $("#databases").val();
else {
alert('returned');
return; }
alert(db);
dbstring = 'fieldmappings.php?dbname=' + db;
//alert(dbstring);
$('#fortune').load(dbstring);
});
$("#btnCheck1").click(function() {
tbl = $("#fortune");
var obj = $.paramquery.tableToArray(tbl);
var newobj = {dataModel: {data:obj.data}, colModel: obj.colModel};
if($("#grid_table").hasClass("pq-grid")){
$("#grid_table").pqGrid("destroy");
}
$("#grid_table").pqGrid(newobj);
});
<script>
var dbstring = 'fieldmappings.php?dbname=' + db;
//alert(dbstring);
$('#fortune').load(dbstring);
tbl = $("#fortune");
var obj = $.paramquery.tableToArray(tbl);
var newobj = {dataModel: {data:obj.data}, colModel: obj.colModel};
if($("#grid_table").hasClass("pq-grid")){
$("#grid_table").pqGrid("destroy");
}
$("#grid_table").pqGrid(newobj);
</script>
$("#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") });
}