- 注册时间
- 2017-7-11
- 最后登录
- 1970-1-1
- 阅读权限
- 10
- 积分
- 66
- 精华
- 0
- 帖子
- 0
|
本帖最后由 xiejunli 于 2017-8-11 14:35 编辑
dforce 发表于 2017-8-11 11:29
看我前面贴的示例
我在field=“MeunName”这一行里加上name=“MenuName”,还是不出来啊。这个是需要处理中转站里返回的datatable数据,把它转换为demo里面txt里的样式,这个应该怎么处理啊,我在网上搜了下用递归处理数据,但是都不能实际用到
就是把这种表格数据结构
{id: "base", text: "Base", menuID:1}
{id: "ajax", text: "Ajax",ParentID:base},
{id: "json", text: "JSON",ParentID:base},
{id: "date", text: "Date",ParentID:base},
{id: "control", text: "Control",ParentID:base},
{id: "messagebox", text: "MessageBox",ParentID:base},
{id: "window", text: "Window",ParentID:base}
转换为下面这种树形结构
[
{id: "base", text: "Base",
children: [
{id: "ajax", text: "Ajax"},
{id: "json", text: "JSON"},
{id: "date", text: "Date"},
{id: "control", text: "Control"},
{id: "messagebox", text: "MessageBox"},
{id: "window", text: "Window"}
]
},
{id: "forms", text: "Forms",
children: [
{id: "button", text: "Button"},
{id: "listbox", text: "ListBox"},
{id: "checkboxlist", text: "CheckBoxList"},
{id: "radiolist", text: "RadioList"},
{id: "calendar", text: "Calendar"},
{id: "textbox", text: "TextBox"},
{id: "password", text: "Password"},
{id: "textarea", text: "TextArea"},
{id: "combobox", text: "ComboBox"},
{id: "datepicker", text: "DatePicker"},
{id: "spinner", text: "Spinner"},
{id: "treeselect", text: "TreeSelect"},
{id: "fileupload", text: "FileUpload"}
]
}
] |
|