Announcement

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

    Filtered SelectItem Displaying Wrong Value

    Given a SelectItem based on a three-column DataSource where
    1. the first column represents a code category
    2. the second a valid code for each category (and possibly duplicated across categories)
    3. a description
    the selected display value can show the description from the wrong row despite filtering on the category. For example, the below code plugged into your online showcase resulted in the display value of "Cat B Opt D" when filtered for category A, with option 'D' selected. The picklist shows the correct options (e.g., "Cat A Opt D"), but that selection ends up displaying "Cat B Opt D". Is this a bug or is there a workaround to make this work without having to have unique datasources for each category?


    Code:
    isc.DataSource.create({
        ID: "testDS",
        fields:[
            {name:"category", title:"Category"},
            {name:"option", title:"Option"},
            {name:"name", title:"Name"}
        ],
        clientOnly: true,
        cacheData: [
        {category: "A", option: "A", name: "Cat A Opt A"},
        {category: "A", option: "B", name: "Cat A Opt B"},
        {category: "A", option: "C", name: "Cat A Opt C"},
        {category: "A", option: "D", name: "Cat A Opt D"},
        {category: "B", option: "D", name: "Cat B Opt A"},
        {category: "B", option: "D", name: "Cat B Opt B"},
        {category: "B", option: "D", name: "Cat B Opt C"},
        {category: "B", option: "D", name: "Cat B Opt D"}
    ]
    })
    
    isc.defineClass("OptSelect", "SelectItem").addProperties({
        optionDataSource:"testDS",
        valueField: "option",
        displayField: "name",
        pickListFields:[{name:"option", width:20},{name:"name",width:100}],
        width: 140,
        filterLocally: true,
        sortField:"option"
    });
    
    isc.DynamicForm.create({
        ID:"testForm",
        width: 500,
        fields : [
          {
            name:"option",
            editorType:"OptSelect",
            pickListCriteria: {category: "A"}
          }
        ]
    });

    #2
    There is no primary key in your DataSource, this is required.

    Comment

    Working...
    X