Blend UI cascadingMenu API文檔

2018-10-17 11:35 更新

Construct

配置所需參數(shù)來初始化一個級聯(lián)菜單組件CascadingMenu

CascadingMenu的配置格式如下:

var cascadingMenu = new Blend.ui.CascadingMenu({"options":"values"});

CascadingMenu包含以下配置項:


id

cascadingMenu的id

類型說明是否必須
StringcascadingMenu的id


實例:

var cascadingMenu = new Blend.ui.CascadingMenu({
    "id": "cascadingMenuTest",
    "menus": [
        {
            id:'00001',
            name:'回龍觀'
        },{
            id:'00002',
            name:'天通苑'
        },{
            id:'00003',
            name:'昌平鎮(zhèn)'
        }
     ]
});


top

配置cascadingMenu距離屏幕top的坐標(biāo)

類型說明是否必須
NumbercascadingMenu距離屏幕top的坐標(biāo),默認(rèn)值在頁面底部


實例:

var cascadingMenu = new Blend.ui.CascadingMenu({
    "id": "cascadingMenuTest",
    "top": 100,
    "menus": [
        {id:0,name:"賬單"},
        {id:1,name:"我的"}
     ]
});


left

配置cascadingMenu距離屏幕left的坐標(biāo)

類型說明是否必須
Number距離屏幕left的坐標(biāo),默認(rèn)值0


實例:

var cascadingMenu = new Blend.ui.CascadingMenu({
    "id": "cascadingMenuTest",
    "top": 100,
    "left":100,
    "menus": [
        {id:0,name:"賬單"},
        {id:1,name:"我的"}
     ]
});


width

配置cascadingMenu寬度

類型說明是否必須
NumbercascadingMenu像素寬度,默認(rèn)為屏幕寬度


實例:


var cascadingMenu = new Blend.ui.CascadingMenu({
    "id": "cascadingMenuCase",
    "top": 100,
    "left":100,
    "widht":100,
    "menus": [
        {id:0,name:"賬單"},
        {id:1,name:"我的"}
     ]
});


height

配置cascadingMenu高度

類型說明是否必須
Number菜單高度,默認(rèn)屏幕高度的1/2


實例:


var cascadingMenu = new Blend.ui.CascadingMenu({
    "id": "cascadingMenuCase",
    "top": 100,
    "left":100,
    "widht":100,
    "height":100,
    "menus": [
        {id:0,name:"賬單"},
        {id:1,name:"我的"}
     ]
});


fixed

是否隨頁面滾動

類型說明是否必須
String是否隨頁面滾動;默認(rèn)為true;


實例:


var cascadingMenu = new Blend.ui.CascadingMenu({
    "id": "cascadingMenuCase",
    "top": 100,
    "left":100,
    "widht":100,
    "height":100,
    "fixed":true,
    "menus": [
        {id:0,name:"賬單"},
        {id:1,name:"我的",
            menus:[
            {id:10,name:"我的xxxx"},
                {id:11,name:"我的xxxx",
            ]
        }
     ]
});


Method

show ( )

把cascadingMenu顯示


實例:


var cascadingMenu = new Blend.ui.CascadingMenu({
    "id": "cascadingMenuCase",
    "top": 100,
    "left":100,
    "widht":100,
    "height":100,
    "fixed":true,
    "menus": [
        {id:0,name:"賬單"},
        {id:1,name:"我的",
            menus:[
            {id:10,name:"我的xxxx"},
                {id:11,name:"我的xxxx",
            ]
        }
     ]
});
cascadingMenu.show();


hide ( )

把cascadingMenu隱藏


實例:


var cascadingMenu = new Blend.ui.CascadingMenu({
    "id": "cascadingMenuCase",
    "top": 100,
    "left":100,
    "widht":100,
    "height":100,
    "fixed":true,
    "menus": [
        {id:0,name:"賬單"},
        {id:1,name:"我的",
            menus:[
            {id:10,name:"我的xxxx"},
                {id:11,name:"我的xxxx",
            ]
        }
     ]
});
cascadingMenu.hide();


selectItem()

選中菜單中的所在項


實例:


var cascadingMenu = new Blend.ui.CascadingMenu({
    "id": "cascadingMenuCase",
    "top": 100,
    "left":100,
    "widht":100,
    "height":100,
    "fixed":true,
    "menus": [
        {id:0,name:"賬單"},
        {id:1,name:"我的",
            menus:[
            {id:10,name:"我的xxxx"},
                {id:11,name:"我的xxxx",
            ]
        }
     ]
});
cascadingMenu.selectItem({
    {
        id:'1',
        menus:[
            {id:'10'}
        ]
    }
});

以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號