0

Permission ListGrid

I have a listgrid that has a custom column PermissionLevel to illustrate the value of the column Value. I want to give users the ability to filter. So..

  1. I set the filterEditorType as "SelectItem"
  2. populated it with the different graph lengths
  3. and set each of the values equal to the corresponding values in Value

I'm not sure how to proceed from here. I was thinking that if I set the filterEditorValueMap so that it would search for values in the column Value it would work the way I want it to, but no luck so far. Perhaps I just don't know how to set filterEditorValueMap

Thanks in advance @claudiobosticco :)

stackoverfloweth
  • 6,669
  • 5
  • 38
  • 69

1 Answers1

1

Actually you gave little context, like the code of the grid and/or a complete mockup of the filter appearance you need.

But, if I understood correctly your use case, a sample like this may be right for it:

isc.ListGrid.create({
    ID: "countryList",
    width: 500, height: 300, alternateRecordStyles: true,
    dataSource: worldDS,
    fields: [
        {
            type: "image", imageURLPrefix: "flags/16/", imageURLSuffix: ".png",
            name: "countryCode", title: "Code", width: 50,
            filterEditorType: "SelectItem",
            filterEditorValueMap: {"US": "US", "CA": "CA"},
            filterEditorProperties: {
                formatValue: function (value, record, form, item) {
                    return form.imgHTML("flags/16/" + value + ".png")
                },
                pickListFields: [
                    {name: "countryCode", type: "image", imageURLPrefix: "flags/16/", imageURLSuffix: ".png"}
                ]
            }
        },
        {name: "countryName", title: "Country"},
        {name: "capital", title: "Capital"},
        {name: "continent", title: "Continent"}
    ],
    autoFetchData: true,
    showFilterEditor: true
})

You may cut'n'paste it in a SmartClient showCase sample like filterSample

claudiobosticco
  • 413
  • 2
  • 8