Revised frontend’s structure of the properties

Frontend’s structure of the properties has been revised to support new mirrorjs (0.1.2) implementations.
Now the backend of a widget can ask frontend-side properties.

For example, this is useful in the widget combobox to get the number of elements or an element at a specified index:

Combobox: Get item counts:

1
2
3
4
5
6
7
combobox.getItemsCount( function(myself, status, count)
    {
        if ( status === true )
        {
            console.log("ItemsCount: ", count);
        }
    });

Combobox: Get the item at the specified index:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
combobox.getItem(/* index */ 13, /* callback */ function(myself, status, item)
    {
        if ( status === true )
        {
            if ( item["key"] === undefined )
            {
                console.log("getItem(): Item not found!");
            }
            else
            {
                console.log("getItem(): key: [" + item["key"] + "] -- Value: [" + item["value"] + "]");
            }
        }
    });

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *