Announcement

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

    ComboBoxItem.addUnknownValues:false not honored while editing grid

    SmartClient Version: v11.0p_2016-07-23/Enterprise Development Only (built 2016-07-23)

    Chrome on OSX

    Hello, please modify the #editByRow sample like this:

    Code:
    isc.ListGrid.create({
        ID: "countryList",
        width:550, 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:"countryCode", title:"Flag", width:40, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png", canEdit:false},
            {name:"countryName"},
            {name:"continent", addUnknownValues:false, editorType:"ComboBoxItem"},
            {name:"member_g8"},
            {name:"population"},
            {name:"independence"}
        ],
        autoFetchData: true,
        canEdit: true,
        editEvent: "click"
    })
    then edit the continent field, typing a non existent value: it will be retained and saved, even if addUnknownValues is set to false.

    #2
    Hi Claudio,
    This code is setting the addUnknownValues on the ListGridField. This isn't supported.
    Instead you could use an 'editorProperties' block to set ComboBoxItem properties (including addUnknownValues) at the ListGridField level and they will be picked up by the generated ComboBoxItem when the user starts editing cells in the grid.

    Regards
    Isomorphic Software

    Comment


      #3
      Oh yes, sorry, pretty basic, thanks for the heads up!

      of course this works:
      Code:
      isc.ListGrid.create({
          ID: "countryList",
          width:550, 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:"countryCode", title:"Flag", width:40, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png", canEdit:false},
              {name:"countryName"},
              {name:"continent", editorProperties:{addUnknownValues:false}, editorType:"ComboBoxItem"},
              {name:"member_g8"},
              {name:"population"},
              {name:"independence"}
          ],
          autoFetchData: true,
          canEdit: true,
          editEvent: "click"
      })

      Comment

      Working...
      X