Hi,
I am getting using the optionDataSource property for the select box to populate the data in my dynamic form. In the datasource creation I am trying to add a row to the returned and set it back to the dsResponse.data but it doesnt seem to change the size of the array. The item is added but as a result the last item is deleted. Please let us know whether anything like this can be done.
I am getting using the optionDataSource property for the select box to populate the data in my dynamic form. In the datasource creation I am trying to add a row to the returned and set it back to the dsResponse.data but it doesnt seem to change the size of the array. The item is added but as a result the last item is deleted. Please let us know whether anything like this can be done.
Code:
isc.DataSource.create({
ID:"sourceOptDS",
serviceNamespace :"http://myservice.abc.com/",
wsOperation : "getSrcSystems",
recordName : "sourceSystem",
autoFetchData: false,
fields:[
{name:"sourceSystemId"},
{name:"sourceSystemName" }
],
transformResponse : function (dsResponse, dsRequest, xmlData) {
if (dsRequest.operationType == "fetch") {
showFault(xmlData);
var temp =new Array(dsResponse.totalRows+1);
temp[0] = {sourceSystemId:"-1", sourceSystemName:"ALL"};
for (var i=0; i<dsResponse.totalRows ; i++)
{
temp[i+1]={sourceSystemId:dsResponse.data[i].sourceSystemId,
sourceSystemName:dsResponse.data[i].sourceSystemName};
}
dsResponse.data = temp;
alert('size'+dsResponse.totalRows);
}
return dsResponse;
}
});
Comment