Hi,
I’m trying to construct a RestDataSource by inheriting a DataSource created using loadXMLSchema() -
isc.XMLTools.loadXMLSchema("/group.xsd", function(schemaset) {
var ds = schemaset.getSchema("group");
ds.recordXPath = "//group";
ds.dataURL = "/group";
ds.getField("key").primaryKey = true;
isc.RestDataSource.create({
ID: "myRestDS",
inheritsFrom: ds,
dataFormat: "xml",
recordXPath: "//group",
fetchDataURL: "/group",
//addDataURL: "/group",
updateDataURL: "/group",
removeDataURL: "/group"
});
alert(myRestDS.getField("key").valueXPath);
isc.ListGrid.create({
autoDraw:false,
width:500, height:224, alternateRecordStyles:true, showAllRecords:true,
dataSource: myRestDS,
autoFetchData: true
});
}
when bound to either DataSource (myRestDS or isc.SchemaSet.get(“http://www.mydomain.com/group").getSchema("group”)), a HTTP GET request is generated, however myRestDS seems unable to parse the result, and no records are displayed in the ListGrid. Both requests respond with identical XML.
The alert in the code above displays ‘undefined’, and I would have thought that the fields in myRestDS would need to have the valueXPath defined. This seems like something that should be determinable from the schema.
Am I approaching this the right way? Thanks.