LigerUI入门帮助(API里没写的入门帮助)【不断更新】

来源:互联网 发布:魅族更新数据能删除吗 编辑:程序博客网 时间:2024/05/17 01:35

【布局:】

 

为了让左边区域(#accordion1)的连接能显示到右边区域(#framecenter)并生成tab选项卡,需创建以下js函数:

function f_heightChanged(options){                if (tab)                    tab.addHeight(options.diff);                if (accordion && options.middleHeight - 24 > 0)                    accordion.setHeight(options.middleHeight - 24);            }function f_addTab(tabid,text, url){                 tab.addTabItem({ tabid : tabid,text: text, url: url });} 


 

然后在 $(function (){ ...........});里加入:

tab = $("#framecenter").ligerGetTabManager();accordion = $("#accordion1").ligerGetAccordionManager();tree = $("#tree1").ligerGetTreeManager();


 

并将#tree1的声明修改为:

$("#tree1").ligerTree({                    data :  .....                    checkbox: false,                    slide: false,                    nodeWidth: 120,                    attribute: ['nodename', 'url'],                    onSelect: function (node)                    {                        if (!node.data.url) return;                        var tabid = $(node.target).attr("tabid");                        if (!tabid)                        {                            tabid = new Date().getTime();                            $(node.target).attr("tabid", tabid)                        }                         f_addTab(tabid, node.data.text, node.data.url);                    }});


 

原创粉丝点击