weixin_38908179 2017-08-25 10:32 采纳率: 0%
浏览 1177

ext里复选框里的值的显示问题

ext里用updateRecord(做修改)之后,复选框的数据在grid里显示的不是之前inputvalue里的值而是true和false,不是inputvalue的问题,求大神解决一下。

附上代码:

Ext.define('Writer.Form1', {
extend: 'Ext.form.Panel',
alias: 'widget.writerformupd',
initComponent: function(){
this.addEvents('create');
Ext.apply(this, {
activeRecord: null,
iconCls: 'icon-user',
frame: true,
title: 'User -- All fields are required',
defaultType: 'textfield',
bodyPadding: 5,
fieldDefaults: {
anchor: '100%',
labelAlign: 'right'
},
items: [{
fieldLabel: '编号',
name: 'userId',
allowBlank: false
}, {
fieldLabel: '姓名',
name: 'uname',
allowBlank: false
}, {
xtype:'numberfield',
fieldLabel: '身高',
name: 'height',
width: 180,
decimalPrecision: 1,
minValue: 0.01,
maxValue: 200,
unitText: ' cm',
allowBlank: false,
blankText: '请输入身高'

            }, {
                xtype:'datefield',
                fieldLabel: '出生日期',
                name:'birthday',
                format: 'Y-m-d',
                editable: false,
                allowBlank: false,
                blankText: '请选择日期'
            }, {        xtype:"fieldcontainer",
                layout:"hbox",
                fieldLabel:'性别',
                defaults: {
                    flex: 1
                },
                items:[{
                    xtype:"radio",
                    boxLabel:"男",
                    name:'sex',
                    inputValue:'男',
                },{
                    xtype:"radio",
                    boxLabel:"女",
                    name:'sex',
                    inputValue:'女',
                }]

            }, {
                layout:'hbox',
                defaults: {
                    flex: 1
                },
                xtype:"fieldcontainer",
                fieldLabel:'爱好',
                items:[{
                    inputValue:'看书',
                    xtype:"checkbox",
                    boxLabel:"看书",
                    name:"like",
                    //id:'checkbox1'
                },{
                    inputValue:'上网',
                    xtype:"checkbox",
                    boxLabel:"上网",
                    name:"like",
                    //id:'checkbox2'
                },{
                    inputValue:'听音乐',
                    xtype:"checkbox",
                    boxLabel:"听音乐",
                    name:"like",
                    //id:'checkbox3'
                }]

            }, {
                xtype:'combobox',
                fieldLabel:'居住地',
                //id:'home',
                name:'home',
                //value:records[0].data.home+"",
                store:Ext.create('Ext.data.Store', {
                    fields: ['abbr', 'name'],
                    data: [{
                        'abbr': '兰州',
                        'name': '兰州'
                    },{
                        'abbr': '青岛',
                        'name': '青岛'
                    },{
                        'abbr': '成都',
                        'name': '成都'
                    }]
                }),//调用后台变量
                emptyText:'请选择家乡' ,
                valueField:'abbr',
                displayField:'name'
            }],
            //items: [userId, uname, height, birthday, sex, like,home],
            dockedItems: [{   //连接项
                xtype: 'toolbar',
                dock: 'bottom',
                ui: 'footer',
                items: ['->', {
                    iconCls: 'icon-save',
                    itemId: 'save',
                    text: 'Save',
                    disabled: true,
                    scope: this,
                    handler: this.onSave
                }, {
                    iconCls: 'icon-reset',
                    text: 'Reset',
                    scope: this,
                    handler: this.onReset
                }]
            }]
        });
        this.callParent();
    },

图片说明

  • 写回答

1条回答 默认 最新

  • devmiao 2017-08-25 15:54
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题