Hi,
When using defaultDynamicValue to set value for a field when adding new record, the dynamic value is not used unless you focus this field.
It's even more problematic if this field is hidden.
Tested using showcase.
Here is a code that shows this behaviour:
To replicate:
1. click Edit New button
2. new editable row appears and cursor is in column countryName - observe editor's value in population column
3. press Enter to end editing
4. observe validiation error in both columns countryName and population
vs.
1. click Edit New button
2. new editable row appears and cursor is in column countryName - observe editor's value in population column
3. press tab few time or click on population editor
4. press Enter to end editing
5. observe validiation error only in column countryName
Please fix this also if the population field would be hidden. It is useful to provide foreign keys for example order number when adding lines to grid showing ordered products.
Best regards,
Janusz
When using defaultDynamicValue to set value for a field when adding new record, the dynamic value is not used unless you focus this field.
It's even more problematic if this field is hidden.
Tested using showcase.
Here is a code that shows this behaviour:
Code:
isc.ListGrid.create({ ID: "countryList", width:500, height:224, alternateRecordStyles:true, // use server-side dataSource so edits are retained across page transitions dataSource: countryDS, // display a subset of fields from the datasource fields:[ {name:"countryName"}, {name:"continent"}, {name:"member_g8"}, { name:"population", required: true, defaultDynamicValue: function(item, form, values) { return 1234; } }, {name:"independence"} ], autoFetchData: true, canEdit: true, editEvent: "click", listEndEditAction: "next" }) isc.IButton.create({ top:250, title:"Edit New", click:"countryList.startEditingNew()" });
1. click Edit New button
2. new editable row appears and cursor is in column countryName - observe editor's value in population column
3. press Enter to end editing
4. observe validiation error in both columns countryName and population
vs.
1. click Edit New button
2. new editable row appears and cursor is in column countryName - observe editor's value in population column
3. press tab few time or click on population editor
4. press Enter to end editing
5. observe validiation error only in column countryName
Please fix this also if the population field would be hidden. It is useful to provide foreign keys for example order number when adding lines to grid showing ordered products.
Best regards,
Janusz
Comment