Sometimes defining callbacks is always overridden by subsequent arguments, which can be easily resolved in the context of anonymous functions.
for (var i=0; i<totaltbllist.length; i++)
{
var idpre= "#" +totaltbllist[i];
var columns = totalcolumms[i];
(Function (idpre, columns) {
JQuery (idpre+ "Table"). Navbuttonadd (idpre+ ' Tablepager ', {
Caption: "Import", Buttonicon: "Ui-icon-plusthick", Onclickbutton:function () {$ (idpre+ "Importdialog"). Dialog ("Open"); Position: "Last"
})
. Navseparatoradd (idpre+ ' Tablepager ', {sepclass: ' Ui-separator ', Sepcontent: '})
. Navbuttonadd (idpre+ ' Tablepager ', {
Caption: "Export", onclickbutton:function () {
Exportimp (idpre+ "Importdialog", idpre+ "Table", columns);
}})
. Navseparatoradd (idpre+ ' Tablepager ', {sepclass: ' Ui-separator ', Sepcontent: '})
. Navbuttonadd (idpre+ ' Tablepager ', {
Caption: "Empty", Buttonicon: "NONE", Onclickbutton:function () {
$ (idpre+ "Table"). Jqgrid ("Cleargriddata");
}). Navseparatoradd (idpre+ ' Tablepager ', {sepclass: ' Ui-separator ', Sepcontent: '})
. Navbuttonadd (idpre+ ' Tablepager ', {
Caption: "Update to Server", Buttonicon: "NONE", Onclickbutton:function () {
var obj ={};
Obj[totalbackendname[idpre]] = Exportimpinner (idpre+ "Table", columns);
Uploadjs ("#statusPanel", Totalbackendname[idpre]
Obj
);
}). Navseparatoradd (idpre+ ' Tablepager ', {sepclass: ' Ui-separator ', Sepcontent: '}). Navbuttonadd (idpre+ ' Tablepager ', {
Caption: "Version", Buttonicon: "NONE", Onclickbutton:function () {
OpenVersion (", Totalbackendname[idpre])
}})
;
;
$ (idpre+ "Tablepager_left"). CSS ("width", "100%");
}) (Idpre, columns);
}