国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 學(xué)院 > 開(kāi)發(fā)設(shè)計(jì) > 正文

Easyui實(shí)用視頻教程系列---Tree點(diǎn)擊打開(kāi)tab頁(yè)面

2019-11-15 02:25:18
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
Easyui實(shí)用視頻教程系列---Tree點(diǎn)擊打開(kāi)tab頁(yè)面

Easyui實(shí)用視頻教程系列---Tree點(diǎn)擊打開(kāi)tab頁(yè)面首先 我們 要搭建環(huán)境 easyui 環(huán)境然后 把tree 給創(chuàng)建出來(lái)在某個(gè)位置 粘貼 下面代碼

<ul id="tt"></ul> 

然后 通過(guò) js代碼 把樹給渲染出來(lái) js代碼如下

  <script type="text/javascript">        $(document).ready(function () {            $('#tt').tree({                url: './admin/loadTree'            });         });    </script>

然后 在controller 里面 加載 tree的json 字符串 返回 給js方法

  public ActionResult LoadTree()        {            string treeJson = BuildTree();            return Content(treeJson);        }        PRivate string BuildTree()        {            //把tree的json格式代碼 創(chuàng)建出來(lái)            return @"[{       ""id"":1,       ""text"":""Folder1"",       ""iconCls"":""icon-save"",       ""children"":[{           ""text"":""File1"",           ""checked"":true       },{           ""text"":""Books"",           ""state"":""open"",           ""attributes"":{               ""url"":""/demo/book/abc"",               ""price"":100           },           ""children"":[{               ""text"":""photoshop"",               ""checked"":true           },{               ""id"": 8,               ""text"":""Sub Bookds"",               ""state"":""closed""           }]       }]   },{       ""text"":""Languages"",       ""state"":""closed"",       ""children"":[{           ""text"":""Java""       },{           ""text"":""C#""       }]   }]  ";        }

然后 我們 就能夠 點(diǎn)擊的時(shí)候 獲取 url了

下一步 動(dòng)態(tài) 創(chuàng)建 tab將布局的中間部分 作為 tab的容器region:'center

    <div  id="tb" class="easyui-tabs" data-options="region:'center'" style="background:#eee;">                 <div title="首頁(yè)" style="padding:20px;display:none;">                   tab1               </div>        </div>  
 <script type="text/Javascript">        $(document).ready(function () {            $('#tt').tree({                url: './admin/loadTree'            });            $('#tt').tree({                onClick: function (node) {                    //alert(node.attributes.url);  // alert node text property when clicked                    // add a new tab panel                       $('#tb').tabs('add', {                        title:  node.text,                        href: node.attributes.url,                        closable: true                    });                  }            });        });           </script>

視頻下載http://pan.baidu.com/share/link?shareid=2301359500&uk=3576826227

需要源碼


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 顺昌县| 玛纳斯县| 怀安县| 玛纳斯县| 江华| 新民市| 肇东市| 仙桃市| 大安市| 博乐市| 广昌县| 雅安市| 锡林浩特市| 鲁山县| 临潭县| 怀来县| 犍为县| 江门市| 荣成市| 克什克腾旗| 永平县| 平舆县| 嘉善县| 衡水市| 永福县| 乐亭县| 庆云县| 革吉县| 庄河市| 教育| 漳州市| 云阳县| 双辽市| 临邑县| 肥西县| 兰考县| 东乡族自治县| 织金县| 新津县| 贵南县| 台东市|