I have written a script in which I use two grids, a dataconnector, a datastore and a contextmenu on the grid.
Loading data into the grids and connecting them with the datastore is not a problem.
Neither is getting the data from my database through the dataconnector.
Everything works allright, but now I just have a small problem.
I am using a contextmenu on the grid.
When I hit refresh on the contextmenu I cannot get the data in the grid to renew.
This what the working part looks like
var lijst_1 = new dhtmlXDataStore({
dataFeed: "./data/xml/grid.php",
url:"./data/xml/grid.php",
datatype:"xml"
});
dp_1 = new dataProcessor("./data/xml/grid.php");
dp_1.enableUTFencoding( true );
dp_1.setTransactionMode( 'POST' , true );
dp_1.init(lijst_1);
grid_1.init();
grid_2.init();
grid_1.sync(lijst_1);
grid_2.sync(lijst_1);
var conmenu = new dhtmlXMenuObject();
conmenu.loadXML('./data/xml/treecontext.xml');
conmenu.renderAsContextMenu();
grid_1.enableContextMenu(conmenu);
conmenu.attachEvent("onClick",rechtsKlik);
This is what the part that doesn’t work looks like:
function rechtsKlik( menuitemId, type ) {
switch ( menuitemId ) {
case 101:
lijst_1.add({});
break;
case 102:
deleteRow();
break;
case 103:
//Does not work!
lijst_1.clearAll();
lijst_1.load("./data/xml/grid.php","xml");
/* maybe this is a solution?
dp_1.init(lijst_1);
grid_1.sync(lijst_1);
*/
break;
}
}
Can anyone please help me with this issue?