i have a listgrid bound to a xml datasource, and two buttons, the first makes a fetchData operation and the second button makes a addData operation, when i push the add button in first place the listgrid dont shows the added record being necessary press the fetch button before the add button (so the add record is showed in the listgrid). I want to know why happend this and how can i resolve it.
the code is:
isc.DataSource.create({
ID:“contacts”,
dataFormat:“xml”,
recordXPath:“//Table”,
//dataURL:http://192.168.1.9/Webservice2/service2.asmx/executeQuery?sSql=%20,
fields:{
au_id:{name:“au_id”},
au_lname:{name:“au_lname”},
au_fname:{name:“au_fname”},
address:{name:“address”}
},
operationBindings:
[
{
operationType:“fetch”,
dataFormat:“xml”,
recordXPath:“//Table”,
dataURL:“http://192.168.1.9/Webservice2/service2.asmx/executeQuery”
},
{
operationType:“add”,
dataFormat:“xml”,
recordXPath:“//Table”,
dataURL:“http://192.168.1.9/Webservice2/service2.asmx/insert”
}
]
});
isc.ListGrid.create({
ID: “boundGrid”,
dataSource: “contacts”,
width: “100%”,
height:“80%”,
//autoFetchData: true
canEdit:true,
editByCell:true,
headerHeight:15
}); isc.IButton.create({
title: “fetch”,
width: 120,
left: 100,
top: 350,
click: “boundGrid.fetchData({sSql:’ '});”
});
isc.IButton.create({
title: “Add”,
width: 120,
left: 250,
top: 350,
click: function ()
{
boundGrid.addData({au_id:’ ‘,au_lname:’ ‘,au_fname:’ ‘,address:’ '});
}
});