<script> function AddRtpfOrg() { Ext.net.DirectMethod.request({ url: 'AddRtpfOrg', cleanRequest: true, params: { parentId: getTreePanel().data.parentid } }); } function getTreePanel(record) { var ids = App.ParentId.value; var id = record.data.parentid; var selectItems = App.TreePanel.getSelectionModel().selected; //if (selectItems.items.length == 0) return null; //return selectItems.items[0]; } </script> } @( x.TreePanel().Collapsible(true).Title("TreePanel").ID("TreePanel") .Collapsible(true) .RootVisible(false) .MultiSelect(true) .SingleExpand(true).FolderSort(true) .TopBar(x.Toolbar() .Items( x.Button().Text("新增...").Icon(Icon.Add).Handler("AddRtpfOrg();"), x.ComboBox(), x.TextField().EmptyText("搜索简称、名称、类型") ) ) .Fields( x.ModelField().Name("parentid"), x.ModelField().Name("id"), x.ModelField().Name("name_abbr"), x.ModelField().Name("name"), x.ModelField().Name("code"), x.ModelField().Name("typeorgtext"), x.ModelField().Name("is_enable"), x.ModelField().Name("is_internal"), x.ModelField().Name("bizscopttext"), x.ModelField().Name("address"), x.ModelField().Name("org_phone"), x.ModelField().Name("manager_name"), x.ModelField().Name("manager_mobile"), x.ModelField().Name("contact_name"), x.ModelField().Name("contact_mobile") ) .ColumnModel( x.Column().Text("父节点").DataIndex("parentid").Hidden(true).ID("ParentId"), x.TreeColumn().Text("简称").DataIndex("name_abbr"), x.Column().Text("名称").DataIndex("name"), x.Column().Text("编码").DataIndex("code"), x.Column().Text("类型").DataIndex("typeorgtext"), x.Column().Text("内部单位").DataIndex("is_enable"), x.Column().Text("是否启用").DataIndex("is_internal"), x.Column().Text("经营范围").DataIndex("bizscopttext"), x.Column().Text("地址").DataIndex("address"), x.Column().Text("单位电话").DataIndex("org_phone"), x.Column().Text("负责人").DataIndex("manager_name"), x.Column().Text("负责人电话").DataIndex("manager_mobile"), x.Column().Text("联系人").DataIndex("contact_name"), x.Column().Text("联系人电话").DataIndex("contact_mobile") ) .Root(Model.RootNode) )
在给树添加子节点的时候。怎么获取其parentId.一直没取到值。谢谢帮忙。
// 获取被选择的静态车次Id
function getStaticBusRecord() {
var selectItems = App.StaticBusPanel.getSelectionModel().selected;
if (selectItems.items.length == 0) return null;
return selectItems.items[0];
看API啊
看了。对treeGrid没起到作用,有待发掘
不懂,这是我第二遍看
谢谢