If I use this code:
in this example:
https://www.smartclient.com/smartcli...e/?id=localAdd
then I'd expect the grid to have an error after I click add data (because I've marked countryName as required and I didn't provide it initially). However, the listgrid doesn't have any errors until I open the menu for the countryName field specifically. My reason for not using startEditingNew is I want to avoid unsaved records so I can use other functionality to help users set the fields (which requires the records to exist).
Triggering startEditing isn't sufficient because if I end editing w/o visiting the countryName field, the requried validator still hasn't been added.
Code:
isc.ListGrid.create({ ID: "countryList", width:500, height:224, alternateRecordStyles:true, data: countryData, canEdit:true, fields:[ {name:"countryCode", title:"Flag", width:50, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png"}, {name:"countryName", title:"Country", required:true, valueMap:["a","b"]}, {name:"capital", title:"Capital"}, {name:"continent", title:"Continent"} ] }) isc.IButton.create({ title:"Add Data", left:0, top:240, width:160, click: function () { countryList.addData({}); countryList.startEditing(countryList.getTotalRows()-1); } }) isc.IButton.create({ title:"Is Valid?", left:200, top:240, width:160, click: function () { isc.say("has errors: "+countryList.hasErrors()); } })
https://www.smartclient.com/smartcli...e/?id=localAdd
then I'd expect the grid to have an error after I click add data (because I've marked countryName as required and I didn't provide it initially). However, the listgrid doesn't have any errors until I open the menu for the countryName field specifically. My reason for not using startEditingNew is I want to avoid unsaved records so I can use other functionality to help users set the fields (which requires the records to exist).
Triggering startEditing isn't sufficient because if I end editing w/o visiting the countryName field, the requried validator still hasn't been added.
Comment