hi, i have a code that creates a treeGrid (see below) the fetch associated to the treeGrid dataSource is returning xml (see below). my problem is that the info is presented in the treeGrid, but when i click on the last treeGrid node appears again (after the last node) all the nodes and, if i click on the last (new) node this occurs again...
<?xml version="1.0" encoding="utf-8" ?>
<NewDataSet>
<Table>
<au_id>1</au_id>
<au_lname>a</au_lname>
<au_fname>b</au_fname>
<address>1</address>
</Table>
<Table>
<au_id>2</au_id>
<au_lname>a</au_lname>
<au_fname>b</au_fname>
<address>1</address>
</Table>
<Table>
<au_id>3</au_id>
<au_lname>a</au_lname>
<au_fname>b</au_fname>
<address>1</address>
</Table>
<Table>
<au_id>4</au_id>
<au_lname>a</au_lname>
<au_fname>b</au_fname>
<address>2</address>
</Table>
<Table>
<au_id>5</au_id>
<au_lname>a</au_lname>
<au_fname>b</au_fname>
<address>2</address>
</Table>
<Table>
<au_id>6</au_id>
<au_lname>a</au_lname>
<au_fname>b</au_fname>
<address>4</address>
</Table>
</NewDataSet>
the code is:
isc.DataSource.create({
transformRequest : function (dsRequest) {
return isc.addProperties({}, dsRequest.oldValues,dsRequest.data);
}, ID:"contacts",
dataFormat:"xml",
recordXPath:"//Table",
//dataURL:'http://192.168.1.9/Webservice2/service2.asmx/executeQuery?sSql=%20',
fields:{
au_id:{name:"au_id", primaryKey:true}, // primary key is necessary for removeData
au_lname:{name:"au_lname"},
au_fname:{name:"au_fname"},
address:{name:"address", rootValue:"1",foreignKey:"contacts.au_id"}
},
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"
},
{
operationType:"remove",
dataFormat:"xml",
recordXPath:"//Table",
dataURL:"http://192.168.1.9/Webservice2/service2.asmx/remove"
},
{
operationType:"update",
dataFormat:"xml",
recordXPath:"//Table",
dataURL:"http://192.168.1.9/Webservice2/service2.asmx/update"
}
]
});
isc.TreeGrid.create({
ID: "employeeTree",
width: 500,
height: 400,
nodeIcon:"icons/16/person.png",
folderIcon:"icons/16/person.png",
showOpenIcons:false,
showDropIcons:false,
closedIconSuffix:"",
dataSource:"contacts",
autoFetchData: false,
data: isc.Tree.create({
modelType: "parent",
rootValue: "1",
nameProperty: "au_lname",
idField: "au_id",
parentIdField: "address"
})
});
//employeeTree.getData().openAll();
employeeTree.fetchData({sSql:'x'});
thanks
<?xml version="1.0" encoding="utf-8" ?>
<NewDataSet>
<Table>
<au_id>1</au_id>
<au_lname>a</au_lname>
<au_fname>b</au_fname>
<address>1</address>
</Table>
<Table>
<au_id>2</au_id>
<au_lname>a</au_lname>
<au_fname>b</au_fname>
<address>1</address>
</Table>
<Table>
<au_id>3</au_id>
<au_lname>a</au_lname>
<au_fname>b</au_fname>
<address>1</address>
</Table>
<Table>
<au_id>4</au_id>
<au_lname>a</au_lname>
<au_fname>b</au_fname>
<address>2</address>
</Table>
<Table>
<au_id>5</au_id>
<au_lname>a</au_lname>
<au_fname>b</au_fname>
<address>2</address>
</Table>
<Table>
<au_id>6</au_id>
<au_lname>a</au_lname>
<au_fname>b</au_fname>
<address>4</address>
</Table>
</NewDataSet>
the code is:
isc.DataSource.create({
transformRequest : function (dsRequest) {
return isc.addProperties({}, dsRequest.oldValues,dsRequest.data);
}, ID:"contacts",
dataFormat:"xml",
recordXPath:"//Table",
//dataURL:'http://192.168.1.9/Webservice2/service2.asmx/executeQuery?sSql=%20',
fields:{
au_id:{name:"au_id", primaryKey:true}, // primary key is necessary for removeData
au_lname:{name:"au_lname"},
au_fname:{name:"au_fname"},
address:{name:"address", rootValue:"1",foreignKey:"contacts.au_id"}
},
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"
},
{
operationType:"remove",
dataFormat:"xml",
recordXPath:"//Table",
dataURL:"http://192.168.1.9/Webservice2/service2.asmx/remove"
},
{
operationType:"update",
dataFormat:"xml",
recordXPath:"//Table",
dataURL:"http://192.168.1.9/Webservice2/service2.asmx/update"
}
]
});
isc.TreeGrid.create({
ID: "employeeTree",
width: 500,
height: 400,
nodeIcon:"icons/16/person.png",
folderIcon:"icons/16/person.png",
showOpenIcons:false,
showDropIcons:false,
closedIconSuffix:"",
dataSource:"contacts",
autoFetchData: false,
data: isc.Tree.create({
modelType: "parent",
rootValue: "1",
nameProperty: "au_lname",
idField: "au_id",
parentIdField: "address"
})
});
//employeeTree.getData().openAll();
employeeTree.fetchData({sSql:'x'});
thanks
Comment