Hi, I recently discovered this product and it looks great, thanks for all the effort you’ve put into it!
I’m tring to build my first app and hit a problem that i simply cannot get to work, and I’m certain it’s just something basic that I’m missing somehow, I’d greatly appreciate a minute of your time so set me straight.
The problem is that I can’t get a DynamicForm using a RestDataSource to apply a filter. I’ve read the docs and this forum, and it seems like it should be a no-brainer - simply use initialCriteria, but I can’t get it to work! I tried filterData also with no luck. The form always comes up populated with the 1st row of the datasource instead of the row identified by the criteria (id 28 in the example) PLEASE tell me what I’m doing wrong..
This is the very simple code I’m using:
isc.RestDataSource.create({
ID: "memberDS",
dataFormat:"json",
titleField:"last_name",
title:"Member",
fetchDataURL:"get_data.php?tbl=member",
addDataURL:"put_data.php?tbl=member",
updateDataURL:"put_data.php?tbl=member",
removeDataURL:"put_data.php?tbl=member",
fields:{
id:{
title:"id",
primaryKey:true,
hidden:true,
type:"integer",
required:true,
length:20,
name:"id"
},
username:{
title:"Username",
type:"text",
required:true,
length:20,
name:"username"
}
})
isc.DynamicForm.create({
dataSource:memberDS,
ID:"form0",
// filterData:{id:28},
initialCriteria:{id:28},
autoDraw:true,
autoFetchData:true
})
isc.VLayout.create({
ID:"VLayout0",
members:[
form0
],
autoDraw:true,
overflow:"hidden",
width:"100%",
height:"100%"
})
PS. one other question - i’m defining all of the datasources in seperate js files and am currently using script src tags to include them in my apps main page, could you please tell me the best practice method of placing/referencing these datasources?
Thanks again for the great job!