Announcement

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

    ListGrid.setFieldError() vs. canEdit

    Hi,

    I need to display a warning/error for some records in a list while the list isn't marked
    editable (canEdit=true), per say.

    I produced the following testbed using http://www.smartclient.com/index.jsp#recordClicks

    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"},
            {name:"capital", title:"Capital"},
            {name:"continent", title:"Continent"}
        ],
        recordClick: "countryList.setFieldError(1, 'countryName', 'this is an error message')"
    })
    
    isc.DetailViewer.create({
        ID:"countryDetails",
        width:500, top:250,
        fields:[
            {name:"countryName", title:"Country"},
            {name:"countryCode", title:"Code"},
            {name:"government", title:"Government"}
        ],
        emptyMessage:"click a row in the grid"
    })
    The field errors seem to be displayed only when the ListGrid is marked editable (in this testbed,
    the error should be showing up when clicking in a cell).

    Is there a way to have errors show up even when the list isn't marked editable?

    Thanks,

    #2
    You could make it editable but mark all fields as non-editable and make the editEvent "none".

    Comment


      #3
      Thanks for the suggested alternative.

      Kind regards,

      Comment

      Working...
      X