I’ve been struggling with getting a form element to display a value based on a datapath. Below is my test code and data. I would appreciate if anyone point out why the settings field on the form isn’t getting populated.
Thanks
isc.setAutoDraw(false);
isc.DataSource.create({
ID: "testDS",
fields: [
{name: "id", primaryKey: true, type: "integer", hidden: true},
{name:"name", title:"Name", required: true},
{name:"fName", title:"First Name", required: true},
{name:"lName", title:"Last Name", required: true},
{name:"config", type: "Config"}
],
dataURL: "/contacts.json"
});
isc.DataSource.create({
ID: "Config",
fields: [
{name:"reportSetting"}
]
});
isc.HLayout.create({
ID: "mainLayout",
members:[
isc.ListGrid.create({
ID: "listGrid",
width:300,
dataSource: "testDS",
fields: [{name: "name"}],
autoFetchData:true,
recordClick:"datamartForm.editRecord(record);"
}),
isc.DynamicForm.create({
width:300,
ID:"datamartForm",
dataSource: "testDS",
fields:[
{
name: "fName"
},
{
name: "lName"
},
{
dataPath:"config/reportSetting", title: "Setting"
}
]
})
]
});
mainLayout.draw();
and here is contacts.json file
[
{
"id":1,
"name":"Ms K Glover",
"salutation":"Ms",
"fName":"Kathy",
"lName":"Glover",
"state":1,
"config":"{\"reportSetting\" : \"abc\", \"chartSetting\" : \"efg\"}"
},
{
"id":2,
"name":"Mr R Glover",
"salutation":"Mr",
"fName":"Rob",
"lName":"Glover",
"state":2,
"config":"{\"reportSetting\" : \"abc\", \"chartSetting\" : \"efg\"}"
}
]
SmartClient Version: SC_SNAPSHOT-2011-05-25/LGPL Deployment (built 2011-05-25)