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混合相关推荐
- Extjs.FormPanel
刚刚学习ExtJS ,备注一哈代码 防止忘记... <html xmlns="http://www.w3.org/1999/xhtml"> <head runat ...
- 2012/8/3 Extjs使用TabPanel时需要注意的问题
在创建Ext.TabPanel时,配置项deferredRender经常会被忽略,关于这个配置项,我们来看一下API文档的解释:"内置地,Tab面板是采用Ext.layout.CardLay ...
- ExtJS FormPanel不执行校验
经检查问题原因在于使用了 validator 属性. 使用validator属性,必须添加返回值.不添加返回值,就会出现FormPanel不执行校验的问题. 转载于:https://www.cnblo ...
- ExtJs FormPanel布局
FormPanel有两种布局:form和column,form是纵向布局,column为横向布局.默认为后者.使用layout属性定义布局类型.对于一个复杂的布局表单,最重要的是正确分割,分割结果直接 ...
- extjs FormPanel更改为普通表单提交,提交到iframe显示
BasicForm提交源代码: * @return {BasicForm} this */ submit : function(options){ options = options || {}; i ...
- Extjs formpanel加载数据的两种方式
1.formpanel数据源和grid相同,使用Form.getForm().loadRecord(row);则数据便可自动加载在formpanel中对应的控件. 2.formpanel数据源是单独的 ...
- 无废话ExtJs 入门教程十七[列表:GridPanel]
无废话ExtJs 入门教程十七[列表:GridPanel] extjs技术交流,欢迎加群(521711109) 在Extjs中,GridPanel用于数据显示,即我们平时说的列表页.在本节中,我们先对 ...
- 关于extjs中动态添加TabPanel的tab项并以iframe显示的整理(转)
出处:http://blog.163.com/baihongtao_618/blog/static/1423479702012392948830/ 近来的项目中用到了Extjs 的TabPanel,这 ...
- extjs gridPanel columnModel renderer笔记
Extjs columnModel为gridPanel的列模型,默认情况下只将dataIndex对应其store的数据按文本格式显示在表格里,可以通过一个renderer属性定义一个function将 ...
最新文章
- C# Label显示多行文本及换行(WinForm/WebForm)
- 【转】商业内幕(Business Insider)网站近期评出了全美20家最具创新力的科技创业公司...
- VMware vSphere Replication 5.5 安装配置【展现虚拟化商业价值征文大赛】
- 鸿蒙系统怎么换windows,求助~鸿蒙系统windows环境搭建(hpm-cli安装失败)!
- linux 视频编辑 ffmpeg,ffmpeg转码视频真的好用!(ffmpeg的简单使用方法)
- 实现一个顺序表的建立、查找、插入和删除操作【数据结构实验报告】
- Ubuntu redmine 安装
- Linux命令查看电脑,linux查看文件大小命令
- java实习第一天日志
- win11浏览器默认主页如何设置
- android编程实例-音乐播放器之歌词显示
- 爬取Bilibili视频评论,并生成云词图
- 新浪微博--分享到微博的简单使用
- html中表格行删除的方法,HTML删除表格行中的空格
- CommandNotFoundError: No command ‘conda activate‘
- 安装eve-ng时选择桥接模式显示vmnet0未运行
- usb hub芯片 android,usb hub芯片GL850G详解
- 如何在Visual Studio代码中隐藏侧栏中的某些文件?
- SCOM2019导入管理包
- Django模型层-多表操作
热门文章
- yii添加模型基础类
- Nginx ab压力测试
- jsp超链接中怎么跳转页面跳转页面_在页面点击超链接跳到别的页面,方法是什么?...
- android实现首页倒计时,android 利用CountDownTimer实现时分秒倒计时效果
- 以独占方式锁定此配置文件失败.另一个正在运行_JVM深入解析:运行时数据区+HotSpot+JMM+堆+GC+JVM优化+类加载
- AlexNet 和 VGG-Net的区别
- Fragment向ChildFragment传值
- tcp 组播_华为组播理论知识详解(二)
- jquery中如何实现一个li里面一排6张图片进行切换
- 小米2s回退出厂版本_雷军很高兴,小米出货量升至全球第四