Extjs FormPanel/TabPanel/GridPanel混合
生活随笔
收集整理的这篇文章主要介绍了
Extjs FormPanel/TabPanel/GridPanel混合
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
tabPanel包含两个FormPanel
Ext.onReady(function () {var tabsDemo = new Ext.TabPanel({renderTo: Ext.getBody(),activeTab: 0, //当前激活标签frame: true,height: 700,items: [{title: '<% = GetLocalResourceObject("FileIssuedText") %>',items: [fileForm]}, {title: '<% = GetLocalResourceObject("ManualIssuedText") %>',items: [manualAllForm]}]});});fileForm/manualAllForm是两个FormPanel
var manualForm = new Ext.grid.EditorGridPanel({width: 700,height: 350,frame: true,//licksToEdit: 2, store: ds,cm: cm});var manualAllForm = new Ext.FormPanel({id: "frm3",autoHeight: true,width: 720,frame: true,items: [new Ext.form.NumberField({id: "txtIssuedNum",fieldLabel: '<% = GetLocalResourceObject("WriteAddRecordText") %>',allowDecimals: false, //不允许输入小数 nanText: '<% = GetLocalResourceObject("WriteIntText") %>', //无效数字提示 allowNegative: false, //不允许输入负数 maxValue: 100, //最大值 minValue: 1 //最小值 }),new Ext.Button({text: '<% = GetLocalResourceObject("SaveText") %>',handler: function () {var num = Ext.getCmp("txtIssuedNum").getValue();if (num < 1) return false;var count = ds.getCount();if (count == num) { return false; }else if (count < num) {var o = num - count;for (var i = 0; i < o; i++) {var iss = new ds.recordType({ISSBANK: "",ISSBRANCHBANK: "",CARDNUM: "",CARDHOLDER: "",AMOUNT: 0.00,MERDETAILREFNUM: "",MERREMARK: ""});ds.addSorted(iss);}}else {var oo = count - num;for (var i = 0; i < oo; i++) {ds.remove(ds.getAt(count - oo));}}}}),manualForm],buttons: [{text: '<% = GetLocalResourceObject("SaveInfoText") %>',handler: function () {var co = ds.getCount();if (co == 0) { Ext.Msg.alert('<% = GetLocalResourceObject("WarnText") %>', '<% = GetLocalResourceObject("WriteRecordText") %>'); return false; }var array = new Array();ds.each(function (record) {array.push(record.data);});var enable = true;for (var i = 0; i < array.length; i++) {var arr = array[i];if (arr.ISSBANK == "" || arr.ISSBRANCHBANK == "" || arr.CARDNUM == "" || arr.CARDHOLDER == "" || arr.AMOUNT < 0.1 || arr.MERDETAILREFNUM == "") {enable = false;}}if (!enable) {Ext.Msg.alert('<% = GetLocalResourceObject("PromptText") %>', '<% = GetLocalResourceObject("WriteFullDataText") %>'); return false;}Ext.Ajax.request({url: "../Handler/Issued.ashx",params: {method: "SaveInfo",dataStore: Ext.util.JSON.encode(array)},success: function (response, option) {var result = Ext.util.JSON.decode(response.responseText);if (result.Flag == true) {Ext.Msg.alert("Success", '<% = GetLocalResourceObject("IssuedSuccessText") %>');ds.removeAll();MerBatchStore.load();} else {Ext.Msg.alert("Fail", result.RespMessage);}},failure: function (response, option) {Ext.Msg.alert("Failed", result.RespMessage);}});}}, {text: '<% = GetLocalResourceObject("SaveApproveText") %>',handler: function () {var co = ds.getCount();if (co == 0) { Ext.Msg.alert('<% = GetLocalResourceObject("WarnText") %>', '<% = GetLocalResourceObject("WriteRecordText") %>'); return false; }var array = new Array();ds.each(function (record) {array.push(record.data);});Ext.Ajax.request({url: "../Handler/Issued.ashx",params: {method: "SaveApproveText",dataStore: Ext.util.JSON.encode(array)},success: function (response, option) {var result = Ext.util.JSON.decode(response.responseText);if (result.Flag == true) {Ext.Msg.alert("Success", '<% = GetLocalResourceObject("IssuedSuccessText") %>');ds.removeAll();} else {Ext.Msg.alert("Fail", result.RespMessage);}},failure: function (response, option) {Ext.Msg.alert("Failed", result.RespMessage);}});}}]});manualForm是一个EditorGridPanel
包含在一个FormPanel manualAllForm中
总结
以上是生活随笔为你收集整理的Extjs FormPanel/TabPanel/GridPanel混合的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 微软开始推送移动版新必应:界面针对聊天优
- 下一篇: html之marquee详解