SMART datagrid v.1 > Classes > GridBase

Back  Forward

DataLudi.GridBase.fillLookupValues  method

Fill the value in LookupSource corresponding to sourceId

and the items as much as levels number of lookup tree should exist in each key being transferred to keys

function fillLookupValues (sourceId: String, keys: Array, values: Array);
Returns
Void
Parameters
sourceId - String. required.
keys - Array. required.
values - Array. required.
Code -1
    $('#fillData').click(function () {
        // "customers" is the id of lookup tree.
        // In each key of keys, there should be the items as much as the number of levels of lookup tree.
        grdMain.fillLookupValues("customers",
            // keys
            [
                ["Google", 5], 
                ["Microsoft", 4], 
                ["Apple", 3],
                ...
            ],
            // values
            [
                "GOOG_5",
                "MSFT_4",
                "AAPL_3",
                ...
            ]
        );
    });
See Also
fillLookupRows
LookupTree
Examples
Data Lookup