Announcement

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

    SelectItem with grouping without display group field

    Is it possible to have a editable grid with a SelectItem as one of its fields and displaying a grid op options (pick list) that is grouped by a field which in itself is not displayed.

    For a normal grid, I believe you can set "detail: true" for a field to prevent it from being shown. I have moderated the example about grouping and it works.

    Code:
    isc.ListGrid.create({
        ID: "countryList",
        width:522, height:224,
        alternateRecordStyles:true, cellHeight:22,
        dataSource: countryDS,
        // display a subset of fields from the datasource
        fields:[
            {name:"countryName"},
            {name:"government"},
            {name:"continent", detail: true}, // HERE THE MAGIC HAPPENS
            {name:"countryCode", title:"Flag", width:40, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png", canEdit:false}
        ],
        groupStartOpen:"all",
        groupByField: 'continent',
        autoFetchData: true
    })
    I attempt to do the same in a data source field:

    Code:
            fields: [
              {name: 'id', hidden: true, primaryKey: true, type: 'integer'},
              {
                name: 'function_id',
                align: 'left',
                displayField: 'name',
                optionDataSource: functionsDataSource,
                pickListFields: [
                  {name: 'name', title: 'Name', width: '*'},
                  {name: 'group', detail: true} // HERE THE MAGIC NOT HAPPENS
                ],
                pickListProperties: {
                  groupByField: 'group',
                  groupStartOpen: 'all',
                  showHeaderContextMenu: false
                },
                pickListWidth: 325,
                required: true,
                type: 'integer',
                title: 'Function',
                valueField: 'id',
                width: '*'
              }

    #2
    detail:true is a property for a DataSourceField and affects treatment across multiple different components. For a ListGridField (what pickListFields is), use showIf:"false" to hide a field.

    Comment


      #3
      Great, didn't know this property was available.
      Thanks for your response.

      Comment

      Working...
      X