节点的增删改。可以一直加下去。图标也会改变

//新增页面
var PanelFormWin = new Ext.Window({
title: "新增节点",
width: 360,
height: 150,
plain: true,
icon: 'Image/Img/searchlistimg.png',
resizable: false,

collapsible: true,
closeAction: "hide",
closable: true,

modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:10px",
items: [PanelForm],
buttons: [{
text: "确定",
minWidth: 70,
handler: function () {
if (PanelForm.getForm().isValid()) {
Ext.Ajax.request({
url: 'SaveNode.ashx',
params: {
pNode: Ext.getDom('hid_NodeNow').value, //读取根节点
ptype: 'Add',
NodeName: Ext.getDom('S_NodeName').value,
Num: Ext.getDom('S_Num').value = Ext.getDom('S_Num').value == null ? 0 : Ext.getDom('S_Num').value,
NodeType: Ext.getDom('hid_ModelName').value,
NodeTypeCode: Ext.getDom('hid_ModelTypeCode').value
},
method: 'POST',
success: function (response, options) {
if (currentNode.leaf) {
//currentNode.leaf = false;
if (currentNode.parentNode != null) {
currentNode.parentNode.reload();
} else {
currentNode.reload();
}
currentNode.expandChildNodes(true);
} else {
currentNode.reload();
}
},
failure: function (response, options) {
Ext.MessageBox.alert('失败', '请求超时或网络故障,错误编号:' + response.status);
}
});
}
PanelFormWin.hide();
}
},
{
text: "重置",
minWidth: 70,
handler: function () {
PanelForm.getForm().reset();
}
},
{
text: "关闭",
minWidth: 70,
handler: function () {
PanelFormWin.hide();
}
}]
})

     //新增容器
var PanelForm = new Ext.FormPanel({
    labelAlign: 'right', buttonAlign: 'right', bodyStyle: 'padding:5px;',
    frame: true, labelWidth: 65, monitorValid: true,
    items: [
        {
            layout: 'column', border: false, labelSeparator: ':',
            defaults: { layout: 'form', border: false, columnWidth: 1 },
            items: [
                { items: [{ xtype: 'textfield', fieldLabel: '节点名称', id: 'S_NodeName', name: 'S_NodeName', anchor: '90%', allowBlank: false, blankText: '请输入节点名称!' }] },
                { items: [{ xtype: 'textfield', fieldLabel: '排  序', id: 'S_Num', name: 'S_Num', anchor: '90%', blankText: '', allowBlank: false, regex: /^\d+$/, regexText: '请输入正确的数据类型', vtype: 'alphanum' }] }
            ]
        }]
});

    急。不会改。就告知。新手入学!!

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐