Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

HowTo: SelectItem, multiple:true, allowEmptyValue: true

$
0
0
Have a js DataSource defined as follows:

Code:

isc.DataSource.create({
        ID: "testTreeDS",
        dataFormat: "json",
        clientOnly: true,
        dataURL: "resources/test-data/aggregatedSkuMktData.js",

    fields: [
        {name: "id", title: "ID", type: "integer", primaryKey: true, hidden: true},
        {name: "parent", title: "Parent", foreignKey: "id", hidden: true},
        {name: "name", title:"SKU"},
        {name: "skudescription", title:"Description"},
        {name: "market", title:"Market", optionDataSource: "skuMktDS", allowEmptyValue: true, multiple: true},
        {name: "userretail", title:"User Retail", canEdit: true},
        {name: "networkid", hidden: true}
    ]
});

And here is the code for the TreeGrid:
Code:

    var treeGrid = isc.TreeGrid.create({
        ID:"skuMarketTreeGrid",
        width: "100%",
        height: "100%",
        autoFetchData: true,
        dataSource: testTreeDS,
        keepParentsOnFilter: true,
        selectionAppearance: "checkbox",
        showFilterEditor: true,
        allowFilterExpressions: true,
        cascadeSelection: true,
        useAllDataSourceFields: true,
        loadDataOnDemand: true,
        showPartialSelection: true,
        folderIcon: null,
        nodeIcon: null,
        alternateRecordStyles: true,
        border: "none",
        borderRadius: "5px"
    });

In the filter dropdown, it is correctly using a SelectItem and the checkboxes show up for the multiple selection. However, there is no entry for null/empty/none/etc. If I set multiple to false, I can see an empty entry in the filter.

Is this because I'm using a databound SelectItem or something? What am missing? Here is the DS for the optionDataSource.

Code:

isc.DataSource.create({
        ID: "skuMktDS",
        dataFormat: "json",
        clientOnly: true,
        dataURL: "resources/test-data/skuMktData.js",

    fields: [
        {name: "id", type: "integer", primaryKey: true, hidden: true},
        {name: "market", title: "Market", type: "text"}
    ]
});


Viewing all articles
Browse latest Browse all 4756

Trending Articles