jQuery MiniUI
标题:
treeselect 问题
[打印本页]
作者:
wslfriend
时间:
2013-12-20 11:22:11
标题:
treeselect 问题
在 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":"状态属性"}]
作者:
felt
时间:
2013-12-20 11:58:26
function onCellBeginEdit(e){
var editor=e.editor;
editor.setData(data)
}
直接这样试试
作者:
wslfriend
时间:
2013-12-20 12:14:58
felt 发表于 2013-12-20 11:58
function onCellBeginEdit(e){
var editor=e.editor;
editor.setData(data)
可以了,谢谢:)
欢迎光临 jQuery MiniUI (http://miniui.com/discuss/)
Powered by Discuz! X2