jQuery MiniUI

 找回密码
 立即注册
查看: 5250|回复: 1
打印 上一主题 下一主题

mini-outlooktree可以直接引用现成树型结构的json数据不? [复制链接]

Rank: 6Rank: 6

跳转到指定楼层
楼主
发表于 2018-2-8 23:47:38 |只看该作者 |倒序浏览
  1. [
  2.     0 => [
  3.         'id' => '1'
  4.         'text' => '职业培训'
  5.         'visible' => 'active'
  6.         'icon' => 'icon wb-library'
  7.         'items' => [
  8.             0 => [
  9.                 'id' => '3'
  10.                 'text' => '计划管理'
  11.                 'url' => '/training/batch/index'
  12.                 'pid' => '1'
  13.                 'icon' => 'fa fa-circle-o'
  14.             ]
  15.             1 => [
  16.                 'id' => '2'
  17.                 'text' => '培训管理'
  18.                 'pid' => '1'
  19.                 'icon' => 'fa fa-circle-o'
  20.                 'items' => [
  21.                     0 => [
  22.                         'id' => '4'
  23.                         'text' => '培训报名'
  24.                         'url' => '/training/default/train-reg'
  25.                         'pid' => '2'
  26.                         'icon' => 'fa fa-circle-o'
  27.                     ]
  28.                     1 => [
  29.                         'id' => '9'
  30.                         'text' => '测试菜单'
  31.                         'pid' => '2'
  32.                         'icon' => 'fa fa-circle-o'
  33.                         'items' => [
  34.                             0 => [
  35.                                 'id' => '10'
  36.                                 'text' => '测试链接'
  37.                                 'url' => '/training/batch/batch-publish'
  38.                                 'pid' => '9'
  39.                                 'icon' => 'fa fa-circle-o'
  40.                             ]
  41.                             1 => [
  42.                                 'id' => '11'
  43.                                 'text' => '测试链接1'
  44.                                 'url' => '/training/default/train-reg-end'
  45.                                 'pid' => '9'
  46.                                 'icon' => 'fa fa-circle-o'
  47.                             ]
  48.                         ]
  49.                     ]
  50.                 ]
  51.             ]
  52.         ]
  53.     ]
  54.     1 => [
  55.         'id' => '5'
  56.         'text' => '系统设置'
  57.         'visible' => ''
  58.         'icon' => 'icon wb-settings'
  59.         'items' => [
  60.             0 => [
  61.                 'id' => '6'
  62.                 'text' => '用户管理'
  63.                 'url' => '/systemmanage/default/user-manage'
  64.                 'pid' => '5'
  65.                 'icon' => 'fa fa-circle-o'
  66.             ]
  67.             1 => [
  68.                 'id' => '7'
  69.                 'text' => '用户授权'
  70.                 'url' => '/admin/user/activate'
  71.                 'pid' => '5'
  72.                 'icon' => 'fa fa-circle-o'
  73.             ]
  74.             2 => [
  75.                 'id' => '8'
  76.                 'text' => '修改密码'
  77.                 'url' => '/admin/user/change-password'
  78.                 'pid' => '5'
  79.                 'icon' => 'fa fa-circle-o'
  80.             ]
  81.         ]
  82.     ]
  83.     2 => [
  84.         'id' => '12'
  85.         'text' => '公文管理'
  86.         'visible' => ''
  87.         'icon' => 'icon wb-settings'
  88.         'items' => [
  89.             0 => [
  90.                 'id' => '15'
  91.                 'text' => '发布公文'
  92.                 'url' => '/document/default/documentsend'
  93.                 'pid' => '12'
  94.                 'icon' => 'fa fa-circle-o'
  95.             ]
  96.             1 => [
  97.                 'id' => '16'
  98.                 'text' => '项目管理'
  99.                 'url' => '/document/project/projectadd'
  100.                 'pid' => '12'
  101.                 'icon' => 'fa fa-circle-o'
  102.             ]
  103.         ]
  104.     ]
  105. ]
复制代码

Rank: 8Rank: 8

沙发
发表于 2018-2-9 10:02:21 |只看该作者
本帖最后由 dforce 于 2018-2-9 10:05 编辑

支持的,我们有属性resultAsTree来控制,根据你的数据的格式来,
如果你的数据是树形的话,可以设置resultAsTree="true".
另外我们的树形结构是这样的json格式由children字段来放下一级数据
{id:"',text:"",children:[
      {},{},{}
     ]
}

Archiver|普加软件

GMT+8, 2025-7-18 23:10 , Processed in 1.035935 second(s), 10 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部