I have a SearchForm with two selects. Each of them is bound to a different datasource. The second select will be populated based on first select. The code is as following:
isc.SearchForm.create({
cellPadding:4,
numCols:6,
fields:[
{ name:"field1",
type: "select",
required: false,
optionDataSource:"myDS1",
valueField:"typeId",
displayField:"desc",
searchForm:this,
change: function (searchForm) {
var typeId = this.getValue('field1');
searchForm.getField('field2').getOptionDataSource().fetchData({typeId:typeId });
}
},
{ name:"field2",
autoFetchData:false,
type: "select",
required: false,
width:200,
optionDataSource:"myDS2",
valueField:"userId",
displayField:"userName"
}
],
});
The problem is:
1. when I selected an item in the first select, the request was sent to the server. However, the value is null and this only happens for the first time.
2. After the selected value changed, the server side sent back the data but the second select is not populated with the data.
Am i missing something here?
Thank you for your help!
isc.SearchForm.create({
cellPadding:4,
numCols:6,
fields:[
{ name:"field1",
type: "select",
required: false,
optionDataSource:"myDS1",
valueField:"typeId",
displayField:"desc",
searchForm:this,
change: function (searchForm) {
var typeId = this.getValue('field1');
searchForm.getField('field2').getOptionDataSource().fetchData({typeId:typeId });
}
},
{ name:"field2",
autoFetchData:false,
type: "select",
required: false,
width:200,
optionDataSource:"myDS2",
valueField:"userId",
displayField:"userName"
}
],
});
The problem is:
1. when I selected an item in the first select, the request was sent to the server. However, the value is null and this only happens for the first time.
2. After the selected value changed, the server side sent back the data but the second select is not populated with the data.
Am i missing something here?
Thank you for your help!
Comment