码迷,mamicode.com
首页 > 其他好文 > 详细

Ext grid单元格加combobox

时间:2016-04-14 11:53:35      阅读:140      评论:0      收藏:0      [点我收藏+]

标签:

var store = Ext.create("app.store.healthRecordManage.form.familyRelationComboStore");

function rendererData(value, cellmeta, record){
    var index = store.find("id",value);
     var record = store.getAt(index);
     var displayText = "";
     if (record == null) {
         displayText = value;
     }else {
        displayText = record.data.value;
     }
  return displayText;
}
var grid_rowexpander = [
    Ext.create(‘Ext.grid.plugin.CellEditing‘,{ clicksToEdit : 1 })
];
 
var grid_columns = [
                    {xtype: ‘rownumberer‘},
                    {header : ‘主键‘,dataIndex : ‘id‘, hidden:true},
                    {header : ‘与户主关系‘, dataIndex : ‘familyrelation‘,flex:.2, editor :new Ext.form.ComboBox({
                          store :store,
                          valueField :"id",
                          displayField :"value",
                          forceSelection :true,
                          typeAhead :true,
                          triggerAction :‘all‘,
                          selectOnFocus :true,// 用户不能自己输入,只能选择列表中有的记录
                         }),renderer:rendererData},
                    {header : ‘个人档案号‘, dataIndex : ‘archivesnumber‘,flex:.2},
                    {header : ‘身份证号‘, dataIndex : ‘certificatenumber‘,flex:.15},
                    {header : ‘姓名‘, dataIndex : ‘name‘,flex:.1},
                    {header : ‘性别‘, dataIndex : ‘genderValue‘,flex:.1},
                    {header : ‘性别‘, dataIndex : ‘gender‘,flex:.1,hidden:true},
                    {header : ‘出生日期‘, dataIndex : ‘birthday‘,flex:.1},
                    {header : ‘联系电话‘, dataIndex : ‘telephone‘,flex:.15},
                    {header : ‘地址‘, dataIndex : ‘domicileaddress‘,flex:.3}
                ];

 

Ext grid单元格加combobox

标签:

原文地址:http://www.cnblogs.com/staryy/p/5390225.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!