I'm trying to move the toolbar and its icons to the top of the phpGrid Lite datagrid. From the phpGrid knowledge base, I got this code:
$dg->cust_prop_jsonstr = 'toppager:true,';
$dg->before_script_end = '
jQuery("#orders")
.navSeparatorAdd("#orders_toppager_left",{
position:"first"
})
.navButtonAdd("#orders_toppager_left",{
caption:"Advanced Search ",
title:"Advanced Search",
buttonicon:"ui-icon-search",
onClickButton: function(){
jQuery("#orders").jqGrid("searchGrid", {multipleSearch:true,showQuery:true});
},
position:"first"
})
.navSeparatorAdd("#orders_toppager_left",{
position:"last"
})
.navButtonAdd("#orders_toppager_left",{
caption:"Export to Excel ",
title:"Export to Excel",
buttonicon:"ui-icon-extlink",
onClickButton: function(){
jQuery("#orders").jqGrid("excelExport",{url:"../export.php?dt=json&gn=orders&export_type=EXCEL"});
},
position:"last"
})
.navSeparatorAdd("#orders_pager1_left",{
position:"first"
})
.navButtonAdd("#orders_pager1_left",{
caption:"Advanced Search ",
buttonicon:"ui-icon-search",
onClickButton: function(){
jQuery("#orders").jqGrid("searchGrid", {multipleSearch:true,showQuery:true});
},
position:"first"
});
(function($) {
$.rand = function(arg) {
if ($.isArray(arg)) {
return arg[$.rand(arg.length)];
} else if (typeof arg === "number") {
return Math.floor(Math.random() * arg);
} else {
return 4; // chosen by fair dice roll
}
};
})(jQuery); ';
I've replace $dg with my datagrid name. But the #orders variable is what's throwing me. The documentation says, "replace "orders" with your own datagrid table name used."
Is the datagrid table name my database table name? I tried that, and it didn't work. Is it my database's name? I tried that, too, and it didn't work. I'm at a loss.