Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    validateOnChange and required property

    Just want to verify a behaviour - if the listgrid says to not validate on change, normally validations are not run except when the required flag is turned on for a field. Isn't this viewed as inconsistent? Checking for requirement of a value is technically a validation. OR is the required flag meant to overwrite validateOnChange property of the listgrid for that field?

    Code:
    isc.ListGrid.create({
        ID: "countryList",
        width:550, height:224, alternateRecordStyles:true, cellHeight:22,validateOnChange:true,
        // use server-side dataSource so edits are retained across page transitions
        dataSource: countryDS,
        // display a subset of fields from the datasource
        fields:[
            {name:"countryCode", title:"Flag", width:40, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png", canEdit:false},
            {name:"countryName",required:true},
            {name:"continent"},
            {name:"member_g8"},
            {name:"population", formatCellValue:"isc.Format.toUSString(value);"},
            {name:"independence"}
        ],
        autoFetchData: true,
        canEdit: true,
        editEvent: "click"
    })

    #2
    If "required" validators were run all required fields would show errors as soon as you typed anything into any field - clearly undesirable - the intent of require is to make sure the user has filled in required fields when the user actually tries to save, so that's when it's run.

    Comment

    Working...
    X