ExtJs6获取form里的数据

1.PanoramForm.js form的items部分


items: [{    xtype: ‘form‘,    id:‘customerF‘,    modelValidation: true,    defaults: {        labelAlign: ‘left‘,        margin: 10,        msgTarget: ‘side‘    },    items: [{        xtype: ‘textfield‘,        name: ‘panoramaId‘,        allowBlank:false,        fieldLabel: ‘设室度主键‘,        bind: {            value: ‘{thePanoram.id}‘        },        editable: false    }],    buttons: [{        text: ‘确定‘,        handler: ‘editPanoram‘    }, {        text: ‘取消‘,        handler: ‘closePanoramWindow‘    }]}]
 

2.PanoramFormController  editPanoram方法

window = me.getView(),//返回本视图模型form = window.down(‘form‘);//与xype=‘form‘遥相呼应

var formValues = form.getValues();//此处可以获取form对象的所有值

formValues[‘panoramaId‘]  //和items里的name相对应
也可以给items里的元素一个id,再用Ext.getCmp(‘idName‘)取得值,id要全局唯一。数据源的获取不可设置id(从数据库查询出的数据)!
editPanoram: function () {
        var me = this,
            window = me.getView(),
            form = window.down(‘form‘);
        if (!form.isValid()) {
            return false;
        }
        var formValues = form.getValues();
        Common.util.Util.doAjax({
            url: Common.Config.requestPath(‘UserPanoram‘, ‘bringIntoMyStudio‘),
            params: {
                panoramaId: formValues[‘panoramaId‘]
            },
            method: ‘post‘,
            callback: function() {
                window.store.loadPage(1);
            }
        }, function () {
            Common.util.Util.toast("纳入工作室成功");
            me.closePanoramWindow();
        });
    },
时间: 2024-08-08 04:00:17

ExtJs6获取form里的数据的相关文章

关于Android中获取Intent里的数据

Intent获取数据和发送数据的办法: //直接通过Intent发送 intent.putExtra("name","wytings"); //直接通过Intent接收String mName= intent.getStringExtra("name"); //通过Bundle发送 Bundle bundle = new Bundle(); bundle.putString("NAME", "wytings"

js获取form表单数据和form表单赋值

$.fn.extend({// 调用方式:$("xxxxx").getform(); getform: function () { var obj = {}; var array = $(this).serializeArray(); $.each(array, function () { obj[this.name] = this.value; }); return obj; }, // 调用方式: $("xxx").setform(json); setform:

选中并获取表格中的数据

1. 对于循环出来的表格,我们需要获取表格的数据,不使用id . 表格: <table class="table" id="userTable"> <thead> <tr> <th>表格标题</th> <th>表格标题</th> <th>表格标题</th> </tr> </thead> <tbody> <tr>

基于BootStrap的initupload()实现Excel上传和获取excel中的数据

简单说明:后边要做exl解析(还没做呢),所以先有一个excel的的上传以及获取excel中的数据,展示出来. 代码: //html代码 <div class="btn-group"> <button class="btn sbold green" id="" onclick="initUpload('excelFile','/vraxx/rightAxx/upload');"> <span cl

asp.net MVC中控制器获取表单form提交的数据之实体类数据

第一次写记录文章,难免有不足之处:欢迎指出. 1.新建一个mvc项目如: 2.新建一个Test.cs 注意get,set方法不能简写 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 using System; using System.Collections.Generic; using System.Linq; usi

ubuntu 下CGI c语言 获取form表单的数据

前面文章:使用cgi c 写了一个helloworld 这次 主要使用CGI c语言 获取form表单的数据 1 login.c [email protected]:/usr/lib/cgi-bin$ cat login.c #include<stdio.h> #include<stdlib.h> #include <string.h> int main(){ int i,len=0; char poststr[100]; char m[10],n[10]; char

ligerui_实际项目_003:form中添加数据,表格(grid)里面显示,最后将表格(grid)里的数据提交到servlet

实现效果: "Form"中填写数据,向本页"Grid"中添加数据,转换成Json数据提交,计算总和,Grid文本框可编辑,排序 图片效果: 总结: //display属性: editor:grid表格可以编辑其类容: //select类型:select+render实现选择填充效果 editor:{ type:"select", data:[{id:"1",text:"品牌一"},{id:"2&q

获取同一个页面里的数据

获取同一个页面里某数据之属性法 html代码: <a id=<s:property value="id" /> onlinearea="<s:property value="online_area" />" notlinearea="<s:property value="notline_area" />" onclick="updatep(this)&qu

jQuery的serialize方法无法获取form数据

长期以来,我一直以为form表单是放数据的,table.tr.td是负责HTML页面显示布局的,他们之间不会互相影响.但是今天出现了这样的一个问题.同样的代码使用jQuery的serialize方法在IE8和IE9上执行是可以获取到form表单数据的,而在IE11上就不行. 经过多次试验.比较.测试发现是因为form标签和table交叉的原因.比如在以下的情况是执行失败的: <table> <form> <tr> <td>姓名</td> <