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

首頁(yè) > 語(yǔ)言 > JavaScript > 正文

JQuery EasyUI 結(jié)合ztrIee的后臺(tái)頁(yè)面開(kāi)發(fā)實(shí)例

2024-05-06 15:12:00
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

JQuery EasyUI 結(jié)合 zTree樹(shù)形結(jié)構(gòu)制作web頁(yè)面.easyui用起來(lái)比較簡(jiǎn)單,很好的封裝了jquery的部分功能,使用起來(lái)更加方便,但是從1.2.3版本以后,商業(yè)用途是需要付費(fèi)的,

zTree是國(guó)內(nèi)的大牛們搞的一個(gè)jquery樹(shù)形tree插件,感覺(jué)很好用,很強(qiáng)大,而且完全免費(fèi),API等做的也非常不錯(cuò).推薦

easyui 是一個(gè)基于 jQuery 的框架,集成了各種用戶界面插件。

easyui 提供建立現(xiàn)代化的具有交互性的 javascript 應(yīng)用的必要的功能。

使用 easyui,您不需要寫太多 javascript 代碼,一般情況下您只需要使用一些 html 標(biāo)記來(lái)定義用戶界面。

HTML 網(wǎng)頁(yè)的完整框架。

easyui 節(jié)省了開(kāi)發(fā)產(chǎn)品的時(shí)間和規(guī)模。

easyui 非常簡(jiǎn)單,但是功能非常強(qiáng)大。

需要的導(dǎo)入以下幾種js文件和樣式表

easyui/themes/default/easyui.csseasyui/themes/icon.css  jquery-1.8.3.jseasyui/jquery.easyui.min.jsztree/jquery.ztree.all-3.5.js(該文件包括core,exhide,exedit,excheck)ztree/zTreeStyle.css<script type="text/javascript">    // ztree菜單設(shè)置 var zTreeObj, setting = {  view: {   selectedMulti: false  },  // 添加編輯設(shè)置:修改樹(shù)節(jié)點(diǎn)名稱/刪除樹(shù)節(jié)點(diǎn)  edit: {   enable: true  },  data: {    simpleData: {     enable: true   }  },  callback:{   onClick: zTreeOnClick  } };  // 回調(diào)函數(shù):單擊事件 function zTreeOnClick(event, treeId, treeNode, clickFlag) {   alert(treeNode.id + ", " + treeNode.name);   var content = '<div style="width:100%;height:100% ;overflow:hidden;">'       +'<iframe src="'       +treeNode.url       +'" scrolling="auto" style="width:100%;height:100%;border:0;"></iframe></div>';  if(treeNode.url != undefined && treeNode.url != ""){   // 當(dāng)centre中是否存在名稱為treeNode.name的tabs   if($("#tt").tabs('exists',treeNode.name)){    $("#tt").tabs('select',treeNode.name);   }else {    $("#tt").tabs('add',{     title:treeNode.name,     content:content,     closable:true    })   }  };  event.preventDefault(); };  // 提供ztree樹(shù)形菜單數(shù)據(jù) zTreeNodes = [ {"id":1, "pId":0, "name":"海賊王"},         {"id":11, "pId":1, "name":"娜美", "url":"http://man.linuxde.net/"},         {"id":12, "pId":1, "name":"羅賓", "url":"http://www.baidu.com"},        {"id":13, "pId":1, "name":"漢庫(kù)克", "url":"http://www.google.cn/"},        { "id":2, "pId":0, "name":"父節(jié)點(diǎn) 2", "open":true},        {"id":21,"pId":2, "name":"葉子節(jié)點(diǎn) 2-1"},        {"id":22, "pId":2, "name":"葉子節(jié)點(diǎn) 2-2"},        {"id":23,"pId":2, "name":"葉子節(jié)點(diǎn) 2-3"},        {"id":3, "pId":0, "name":"父節(jié)點(diǎn) 3", "open":true},        {"id":31, "pId":3, "name":"葉子節(jié)點(diǎn) 3-1"},        {"id":32, "pId":3, "name":"葉子節(jié)點(diǎn) 3-2"},        {"id":33, "pId":3, "name":"葉子節(jié)點(diǎn) 3-3"}       ];  // 3.生成樹(shù)形菜單 $(document).ready(function(){  zTreeObj = $.fn.zTree.init($("#tree"), setting, zTreeNodes); });  // 4.對(duì)象選項(xiàng)卡注冊(cè)右擊事件 $(document).ready(function(){  $("#tt").tabs({   onContextMenu:function(e,title,index){   // 阻止系統(tǒng)默認(rèn)的右擊事件    e.preventDefault();    $('#mm').menu('show', {     left: e.pageX,     top: e.pageY    });    }  }); });  // 獲取所選取的面板對(duì)象 $(document).ready(function(){  $("#tt").tabs({   // 獲取所選取的面板對(duì)象   onSelect : function(title,index ){    // 5. menu的單擊事件綁定    $("#mm").menu({      onClick:function(item){       alert(item.name);      // 當(dāng)點(diǎn)擊關(guān)閉當(dāng)前選項(xiàng)卡時(shí)      if(item.name==='current'){       $('#tt').tabs('close',title);      // 當(dāng)點(diǎn)擊關(guān)閉其他選項(xiàng)卡時(shí)      }else if(item.name === 'others'){       var tabs = $('#tt').tabs('tabs');       $(tabs).each(function(){        if($(this).panel('options').title != '消息中心' && $(this).panel('options').title != title){         $('#tt').tabs('close',$(this).panel('options').title);        }       });      // 當(dāng)點(diǎn)擊關(guān)閉所有選項(xiàng)卡時(shí)      }else if(item.name === 'all'){       var tabs = $('#tt').tabs('tabs');       $(tabs).each(function(){          if($(this).panel('options').title != '消息中心'){         $('#tt').tabs('close',$(this).panel('options').title);        }       });      }     }     });   }  }) }) </script>            
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 基隆市| 漾濞| 鲁甸县| 深泽县| 淳安县| 天长市| 金塔县| 澄江县| 江安县| 鄂托克前旗| 通海县| 观塘区| 永寿县| 新昌县| 二连浩特市| 永和县| 剑川县| 封丘县| 福贡县| 石柱| 长乐市| 关岭| 福海县| 淳安县| 大宁县| 龙岩市| 鄂尔多斯市| 承德市| 左云县| 金平| 日土县| 盐边县| 绵阳市| 沙河市| 北辰区| 宁城县| 江门市| 双辽市| 林州市| 沙洋县| 涟源市|