完整案例
~~~
$list = $this->getQuestionBankList();
$tbuilder = TBuilder('tree',$this)->setRowList($list);
return $tbuilder->addTopButton([ //添加頂部按鈕
'type' => 'add',
'icon_class'=> 'fa fa-plus-circle',
'href' => url('addQuestionBank'),
'popup' => true,
'attr' => ['modal-wh'=>'400|230']
])
->addTopButton([
'type' => 'custom',
'title' => '保存分組',
'item_class'=> 'save_sort_list_data',
'icon_class'=> 'fa fa-check',
'href' => 'javascript:;',
])
->addTopButton([
'type' => 'custom',
'title' => '展開所有節點',
'icon_class'=> 'fa fa-plus',
'href' => 'javascript:;',
])
->addTopButton([
'type' => 'custom',
'title' => '收起所有節點',
'icon_class'=> 'fa fa-minus',
])
// 添加顯示元素
->setColumns([ // 批量設置數據列
['title.text', '名稱'],
['', '操作', ['type'=>'btn']]
])
// 添加相關操作按鈕
->addListButton([
'type' => 'edit',
'href_base' => 'editQuestionBank',
'icon_class'=> 'fa fa-pencil',
'popup' => true,
'attr' => ['modal-wh'=>'400|230']
])
->addListButton([
'type' => 'add',
'href_base' => 'addQuestionBank',
'href_param'=> 'pid.id',
'popup' => true,
'attr' => ['modal-wh'=>'400|230']
])
->addListButton([
'type' => 'del',
'href_base' => 'delQuestionBank',
'icon_class'=> 'fa fa-remove text-danger-light',
])
->addListButton([
'title' => '題目管理',
'is_show_title' => 1,
'item_class' => 'btn-alert',
'icon_class' => 'fa fa-th-list',
'href_base' => 'topic/index',
'href_param' => 'qb_id.id',
])
->fetch();
~~~
備注說明
* list按鈕文字說明在樹形組件中隱藏,需要顯示配置is_show_title為1即可
- 序言
- 環境搭建
- 下載及安裝
- 構建器
- 構建器概述
- 模版構建器(TBuilder)
- Tab組件
- Topbar組件
- 按鈕
- 頂部按鈕配置
- 按鈕配置明細
- 表格(table)
- Table案例
- 「方法」加載數據
- 「方法」設置數據列
- 「方法」列排序
- 「組件」檢索過濾器
- 「組件」頂部按鈕
- 「組件」列表按鈕
- 「配置」列快速編輯
- 「配置」列附加內容
- 「配置」顯隱列表復選框
- 「配置」自定義樣式
- 表單(form)
- Form案例
- 「方法」添加組件(addWidgets)
- 「方法」數據檢索過濾(filter)
- 「組件」富文本編輯器(kindeditor|editormd)
- 「組件」圖片組件(images|cropper)
- 「組件」select listbox組件(listbox)
- 「組件」顏色選擇器(button_color)
- 「組件」自定義內容
- 「配置」顯隱字段關聯(open_by)
- 「配置」form布局(layoutView)
- 「配置」隱藏描述區(hideWidgetsDesc)
- 「配置」數據驗證(validate)
- 「配置」隱藏表單底部按鈕(hideFormButton)
- 「配置」字段tip提示(tip)
- 自定義頁面(custom)
- Custom案例
- 「組件」echart
- 「組件」Tile Widgets
- 「配置」custom布局
- 「配置」自定義html內容
- 「配置」自定義提醒頁面
- 樹形(tree)
- Tree案例
- 左側菜單區配置
- 關閉左側菜單(hideLeftMenu)
- 頂部按鈕配置
- 自定義菜單配置
- 展現方式配置
- 表內增刪改(Tabullet)
- 通用設置
- 依賴文件加載(插件/js/css)
- 指定布局/模版
- 內容定位欄(setTrayMenu)
- 設置內容區側欄
- 模態框打開頁面
- 組件構建器(TWidget)
- echarts
- table
- form組件
- Tabs組件
- builder構建
- titleLine
- 數據構建器(DBuilder)
- 概述(案例)
- 「方法」獲取單條記錄詳情
- 「方法」獲取分頁列表數據
- 「方法」排序
- 「方法」設置查詢字段
- 「方法」快速編輯
- 「方法」數據導出
- 「方法」聯表查詢
- 「方法」查詢數據再處理
- 「配置」回調處理
- 「配置」設置過濾字段
- 「配置」指定過濾字段匹配值
- 「配置」增加編輯支持
- 「配置」查詢出全部數據
- 輔助類
- Excle
- 模塊開發
- 插件開發
- 擴展
- 行為擴展
- 行為日志
- 雜項
- 圖片異步加載
- jquery插件zeroModal
- 提示
- form表單驗證
- ajax相關
- 展開收起
- 常用函數
- 其他插件
- DEMO
- 增刪改查
- 安全
- XSS 攻擊
- 注入攻擊
- CSRF 攻擊
- 其他攻擊和漏洞
- 開發
- TBuilder組件開發
- 更新日志
- 關于文檔