`
xys_777
  • 浏览: 203886 次
  • 性别: Icon_minigender_1
  • 来自: 大连
社区版块
存档分类
最新评论

pb11.5 web开发 - treeview的使用没有任何问题

 
阅读更多

看到很多网友都有使用treeview的问题,而且还有人总是给出一些误导性的回答,特此写了此文证实treeview在web中依然很好用

首先看我的两个treeview:

1、是一个设置功能的:

打开时:

1

点开节点

2

在浏览器里:

3

2、这个大家应该比较熟

4

5

再来一个treeview的datawindow:

6

相信大家看到这些,不会再对pb11.5开发web界面上使用treeview有什么可怀疑的了吧

部分代码

1、treeview初始化部分

tv_1.deleteitem(0)
dw_function.retrieve()
dw_Action. retrieve()
dw_Status. retrieve()
dw_righttype. retrieve()


long ll_handle
treeviewitem l_tvi

str_function lstr_function

l_tvi.label="Function"
lstr_function.dec_pid=0
lstr_function.dec_id=0
lstr_function.dw_pcolumn ="0"
lstr_function.dw_column="t_sysfunctionid"
lstr_function.dw_data = dw_function
lstr_function.label = "fundescription"
l_tvi.data= lstr_function

l_tvi.level=1
l_tvi.children =true
l_tvi.pictureindex=l_tvi.level
l_tvi.statepictureindex=0
ll_handle = tv_1.InsertItemlast(0,l_tvi)
tv_1.expanditem( ll_handle)

l_tvi.label="Action"
lstr_function.dec_pid=0
lstr_function.dec_id=0
lstr_function.dw_pcolumn ="0"
lstr_function.dw_column="t_sysactionid"
lstr_function.dw_data = dw_Action
lstr_function.label = "actionname"
l_tvi.data= lstr_function

l_tvi.level=1
l_tvi.children =true
l_tvi.pictureindex=l_tvi.level
l_tvi.statepictureindex=0
ll_handle = tv_1.InsertItemlast(0,l_tvi)

l_tvi.label="Status"
lstr_function.dec_pid=0
lstr_function.dec_id=0
lstr_function.dw_pcolumn ="0"
lstr_function.dw_column="t_sysstatusid"
lstr_function.dw_data = dw_Status
lstr_function.label = "statusname"
l_tvi.data= lstr_function

l_tvi.level=1
l_tvi.children =true
l_tvi.pictureindex=l_tvi.level
l_tvi.statepictureindex=0
ll_handle = tv_1.InsertItemlast(0,l_tvi)

l_tvi.label="Righttype"
lstr_function.dec_pid=0
lstr_function.dec_id=0
lstr_function.dw_pcolumn ="0"
lstr_function.dw_column="t_sysRighttypeid"
lstr_function.dw_data = dw_righttype
lstr_function.label = "Righttypename"
l_tvi.data= lstr_function

l_tvi.level=1
l_tvi.children =true
l_tvi.pictureindex=l_tvi.level
l_tvi.statepictureindex=0
ll_handle = tv_1.InsertItemlast(0,l_tvi)

treeview的itempopulate:这个比较长,只贴了部分

long ll_count,i

treeviewitem l_tvi,l_tvichild
str_function lstr_function,lstr_functionchild
datawindow ldw
GetItem(handle,l_tvi )

lstr_function = l_tvi.data
ldw =lstr_function.dw_data
ldw.retrieve()
choose case l_tvi.level
case 1
ll_count=ldw.rowcount()
for i=1 to ll_count
l_tvichild.label = ldw.getitemstring(i,lstr_function.label)
lstr_functionchild.dec_pid=lstr_function.dec_pid
lstr_functionchild.dec_id=ldw.getitemdecimal(i,lstr_function.dw_column )
lstr_functionchild.dw_data=lstr_function.dw_data
lstr_functionchild.dw_column = lstr_function.dw_column
lstr_functionchild.dw_pcolumn = lstr_function.dw_pcolumn

l_tvichild.data = lstr_functionchild
l_tvichild.level = l_tvi.level+1
l_tvichild.pictureindex=l_tvichild.level
l_tvichild.statepictureindex=0
if l_tvi.label = "Function" then
l_tvichild.children=true
end if
tv_1.InsertItemLast(handle,l_tvichild)
next
case 2
if l_tvi.children = false then return
l_tvichild.level = l_tvi.level+1
l_tvichild.pictureindex=l_tvichild.level
l_tvichild.statepictureindex=0
l_tvichild.children=true

l_tvichild.label = "用户权限"
lstr_functionchild.dec_pid = ldw.getitemdecimal(1,lstr_function.dw_column )
lstr_functionchild.dec_id=0
lstr_functionchild.dw_data=dw_function_user
lstr_functionchild.dw_pcolumn=lstr_function.dw_column
lstr_functionchild.dw_column = "t_sysfunction_userid"
lstr_functionchild.label = "t_sysuser_username"
l_tvichild.data = lstr_functionchild
tv_1.InsertItemLast(handle,l_tvichild)

2、初始化

//
treeviewitem ltvi_child
long ll_root

This.DeleteItem(0)

ltvi_child.label = "主菜单"
ltvi_child.data =am_menu
ltvi_child.pictureindex=1
ltvi_child.selectedpictureindex=1
wf_setstate(am_menu,ltvi_child)
if upperbound( am_menu.item) >0 then
ltvi_child.children =true
end if

ll_root=this.insertitemLast( 0, ltvi_child)
this.ExpandItem ( ll_root )

itempopulate:

menu lm_this
long ll_childcount,i
TreeViewItemltvi_child,ltvi_this
This.GetItem(handle, ltvi_this)
lm_this = ltvi_this.Data

ll_childcount =upperbound( lm_this.item)
FOR i = 1 TO ll_childcount
ltvi_child.label = lm_this.item[i].text
ltvi_child.data = lm_this.item[i]
ltvi_child.pictureindex=2
ltvi_child.selectedpictureindex=2
if upperbound( lm_this.item[i].item) >0 then
ltvi_child.children =true
end if
wf_setstate( lm_this.item[i],ltvi_child )

this.insertitemLast( handle, ltvi_child)
NEXT

分享到:
评论

相关推荐

    matlab开发-TreeView

    matlab开发-TreeView。基于Matlab图形组件的TreeView对象

    bootstrap树 bootstrap-treeview完整例子

    强烈建议初次使用bootstrap的人参考,例子很全...bootstrap树控件使用bootstrap-treeview.js实现树前边多选框checkbox 并实现, 0、获取选中的项 1、点击父级的多选框,自己默认选中 2、全选 3、反选 4、展开、 5、折叠

    bootstrap-treeview下载

    bootstrap下拉树(只有JS和CSS两个文件)

    bootstrap-treeview压缩包文件

    bootstrap-treeview的压缩包,其中包括bootstrap-treeview.css文件和bootstrap-treeview.js文件

    bootstrap-treeview

    bootstrap-treeview.js下载

    bootstrap-treeview.min.js

    bootstrap框架需要的js bootstrap-treeview.min.js

    Angular-ngx-treeview.zip

    Angular-ngx-treeview.zip,带checkboxngx树视图的角度树视图组件,Angularjs于2016年发布,是Angularjs的重写版。它专注于良好的移动开发、模块化和改进的...angular的设计目的是全面解决开发人员的web应用程序工作流。

    bootstrap-treeview源码

    bootstrap树控件使用bootstrap-treeview.js实现树前边多选框checkbox 并实现, 0、获取选中的项 1、点击父级的多选框,自己默认选中 2、全选 3、反选 4、展开、 5、折叠

    bootstrap-treeview-master 完整源码和demo

    bootstrap-treeview-master 完整源码和demo

    bootstrap-treeview-demo增删改无刷新

    bootstrap-treeview的增删改无刷新的完整demo,github地址:https://github.com/merciqiao/bootstrap-treeview-demo/

    bootstrap-treeview史上最强例子

    强烈建议初次使用bootstrap的人参考,例子很全...bootstrap树控件使用bootstrap-treeview.js实现树前边多选框checkbox 并实现, 0、获取选中的项 1、点击父级的多选框,自己默认选中 2、全选 3、反选 4、展开、 5、折叠

    bootstraptable-treeview树形,树形空格缩进bug已解决

    bootstraptable-treeview树形,树形空格缩进bug已解决。

    bootstrap-treeview.zip

    根据整合去改bootstrap-treeview.js,注意新增和删除需要选择,还没有加批量删除,你需要自己试着改写下

    ngx-treeview:带有复选框的Angular treeview组件

    ngx-treeview 带有复选框的Angular Treeview组件 依存关系 该组件当前支持Bootstrap4。如果您正在使用Bootstrap 4 alpha 6,请降级到较早的版本1.0.10。 您可以自己定制CSS,以分解对Bootstrap的依赖性。 产品...

    bootstrap-treeview demo

    bootstrap-treeview 提供树形控件全选、反选、取消、折叠操作。适用于权限管理操作。

    1-TreeView示例-拖放操作

    1-TreeView示例-拖放操作1-TreeView示例-拖放操作1-TreeView示例-拖放操作1-TreeView示例-拖放操作1-TreeView示例-拖放操作1-TreeView示例-拖放操作1-TreeView示例-拖放操作1-TreeView示例-拖放操作1-TreeView示例-...

    React-treeview.zip

    React-treeview 是使用 React 模式设计的 Web 上的树壮组件。 在线演示:http://chenglou.github.io/react-treeview/ 标签:React

    java种菜源码-tr-ngx-treeview:tr-ngx-treeview

    如果您使用的是 Bootstrap 4 alpha 6,请降级到旧版本 1.0.10。 您可以自己自定义 CSS 以分解对 Bootstrap 和 Font Awesome 的依赖。 特征 无限的树级别 状态:禁用/折叠、展开 过滤 国际化 (i18n) 支持 模板 三态复...

    jquery-treeview实例

    jquery-treeview 里面包括完整例子.js包.和帮助文档

Global site tag (gtag.js) - Google Analytics