jQuery MiniUI

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

treeselect 问题 [复制链接]

Rank: 4

跳转到指定楼层
楼主
发表于 2013-12-20 11:22:11 |只看该作者 |倒序浏览
在  datagrid 中,有一列是下拉树。
直接采用  url="aaa.txt"  可以正常显示,

但采用js 脚本动态加载则无论如何也显示不了。
语法如下:
拦截grid 的 CellBeginEdit 事件
var onPropertyCellBeginEdit = function (e) {
            var row = e.record;

            if (e.field == "PropertyUse") {
                var column = gridPropertyList.getColumn(e.field);
                var newData = formManage.getSelectDataObject().PropertyUseList.children;
                gridPropertyList.updateColumn(column, { editor: { type: "treeselect", data: newData} });
            }
        }


下拉框总是空白。   (      mini.get("test").setData(newData);   也能正常显示)
json 格式是
[{"id":"KeyGroup","children":[{"PropertyType":"System.Type[]","id":"ForeignKey","isLeaf":true,"Alias":"PropertyUse","text":"外键属性"},
{"PropertyType":"","id":"ForeignLinkValue","isLeaf":true,"Alias":"PropertyUse","text":"外键关联属性"}],
"isLeaf":true,"Alias":"Group","text":"关键属性"},{"id":"None","isLeaf":true,"Alias":"Group","text":"空"},
{"id":"Operational","children":[{"PropertyType":"System.Type[]","id":"Avg","isLeaf":true,"Alias":"PropertyUse","text":"平均值"},{"PropertyType":"System.Type[]","id":"Count","isLeaf":true,"Alias":"PropertyUse","text":"总数"},{"PropertyType":"System.Type[]","id":"Sum","isLeaf":true,"Alias":"PropertyUse","text":"合计值"}],"isLeaf":true,"Alias":"Group","text":"运算属性"},{"id":"StatusGroup","children":[{"PropertyType":"System.Type[]","id":"RecycleHumId","isLeaf":true,"Alias":"PropertyUse","text":"记录作废人ID"},{"PropertyType":"System.Type[]","id":"RegDate","isLeaf":true,"Alias":"PropertyUse","text":"当前录入时间"},{"PropertyType":"System.Type[]","id":"RegDeptId","isLeaf":true,"Alias":"PropertyUse","text":"当前部门"},{"PropertyType":"System.Type[]","id":"RegHumId","isLeaf":true,"Alias":"PropertyUse","text":"当前录入人ID"},{"PropertyType":"System.Type[]","id":"RegHumName","isLeaf":true,"Alias":"PropertyUse","text":"当前录入人姓名"},{"PropertyType":"System.Type[]","id":"RegMajorId","isLeaf":true,"Alias":"PropertyUse","text":"当前专业"},{"PropertyType":"System.Type[]","id":"RegPosiId","isLeaf":true,"Alias":"PropertyUse","text":"当前岗位"},{"PropertyType":"System.Type[]","id":"UpdDate","isLeaf":true,"Alias":"PropertyUse","text":"最后更新时间"},{"PropertyType":"System.Type[]","id":"UpdHumId","isLeaf":true,"Alias":"PropertyUse","text":"最后更新人ID"},{"PropertyType":"System.Type[]","id":"UpdHumName","isLeaf":true,"Alias":"PropertyUse","text":"最后更新人姓名"}],"isLeaf":true,"Alias":"Group","text":"状态属性"}]

Rank: 8Rank: 8

沙发
发表于 2013-12-20 11:58:26 |只看该作者
function onCellBeginEdit(e){
     var editor=e.editor;
    editor.setData(data)
}
直接这样试试

Rank: 4

板凳
发表于 2013-12-20 12:14:58 |只看该作者
felt 发表于 2013-12-20 11:58
function onCellBeginEdit(e){
     var editor=e.editor;
    editor.setData(data)

可以了,谢谢:)

Archiver|普加软件

GMT+8, 2024-11-27 08:41 , Processed in 1.037617 second(s), 9 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部