Extjs之rowEditing编辑状态时列不对齐
Extjs在使用rowEditing的时候,会在每一列加上editor属性,表示当处于编辑状态时这一列的值是什么类型的,后突然发现在rowEditing处于编辑状态时每一列的宽度边框了,如果列数非常多的话会出现列向后推,知道最后一列被隐藏或是看不到,当然通过tan键是可以到最后的,但是处于编辑状态的列与上面的列名不相互对应了,出现了列不齐的状况,如下图:
未编辑前:

双击处于编辑状态:

很明显的看到每一列都不对应了,解决这个问题的办法就是在每一列的editor属性上面加上maxWidth这个配置,加上之后效果如下:

源码:
var haomglGeimjGrid = Ext.create('Ext.grid.Panel', {
id: 'haomglGeimjGrid',
name: 'haomglGeimjGrid',
width: panelWidth,
height: 120,
store: haomglGeimjGrid_store,
header: false,
columnLines : true,
selModel: selModelGeimj,
autoScroll : true,
selType: 'cellmodel',
plugins: [rowEditingGeimj],
columns: [{
xtype: 'gridcolumn',
dataIndex: 'name',
width: 100,
align: 'center',
header:'<div style=" text-align: center; vertical-align: middle;">给煤机</div>',
text: 'String',
emptyCellText: '耗煤量(吨)',
editor: {
xtype: 'textfield',
maxWidth: 90,
width: 90,
readOnly: true,
value: '耗煤量(吨)',
emptyText: '耗煤量(吨)'
}
}, {
xtype: 'gridcolumn',
text: '#7号机组',
header:'<div style=" text-align: center; vertical-align: middle;">#7号机组</div>',
columns: [{
xtype: 'numbercolumn',
dataIndex: 'geimj_7_a',
align: 'center',
width: 85,
header:'<div style=" text-align: center; vertical-align: middle;">A</div>',
text: 'A',
editor : {
xtype : 'numberfield',
maxWidth: 80,
width: 80,
allowBlank : true,
minValue : 0
}
}, {
xtype: 'numbercolumn',
dataIndex: 'geimj_7_b',
align: 'center',
width: 85,
header:'<div style=" text-align: center; vertical-align: middle;">B</div>',
text: 'B',
editor : {
xtype : 'numberfield',
maxWidth: 80,
width: 80,
allowBlank : true,
minValue : 0
}
}, {
xtype: 'numbercolumn',
dataIndex: 'geimj_7_c',
align: 'center',
width: 85,
header:'<div style=" text-align: center; vertical-align: middle;">C</div>',
text: 'C',
editor : {
xtype : 'numberfield',
maxWidth: 80,
width: 80,
allowBlank : true,
minValue : 0
}
}, {
xtype: 'numbercolumn',
dataIndex: 'geimj_7_d',
align: 'center',
width: 85,
header:'<div style=" text-align: center; vertical-align: middle;">D</div>',
text: 'D',
editor : {
xtype : 'numberfield',
maxWidth: 80,
width: 80,
allowBlank : true,
minValue : 0
}
}, {
xtype: 'numbercolumn',
dataIndex: 'geimj_7_e',
align: 'center',
width: 85,
header:'<div style=" text-align: center; vertical-align: middle;">E</div>',
text: 'E',
editor : {
xtype : 'numberfield',
maxWidth: 80,
width: 80,
allowBlank : true,
minValue : 0
}
}, {
xtype: 'numbercolumn',
dataIndex: 'geimj_7_f',
align: 'center',
width: 85,
header:'<div style=" text-align: center; vertical-align: middle;">F</div>',
text: 'F',
editor : {
xtype : 'numberfield',
maxWidth: 80,
width: 80,
allowBlank : true,
minValue : 0
}
}]
}, {
xtype: 'gridcolumn',
text: '#8号机组',
header:'<div style=" text-align: center; vertical-align: middle;">#8号机组</div>',
columns: [{
xtype: 'numbercolumn',
dataIndex: 'geimj_8_a',
align: 'center',
width: 85,
header:'<div style=" text-align: center; vertical-align: middle;">A</div>',
text: 'A',
editor : {
xtype : 'numberfield',
maxWidth: 80,
width: 80,
allowBlank : true,
minValue : 0
}
}, {
xtype: 'numbercolumn',
dataIndex: 'geimj_8_b',
align: 'center',
width: 85,
header:'<div style=" text-align: center; vertical-align: middle;">B</div>',
text: 'B',
editor : {
xtype : 'numberfield',
maxWidth: 80,
width: 80,
allowBlank : true,
minValue : 0
}
}, {
xtype: 'numbercolumn',
dataIndex: 'geimj_8_c',
align: 'center',
width: 85,
header:'<div style=" text-align: center; vertical-align: middle;">C</div>',
text: 'C',
editor : {
xtype : 'numberfield',
maxWidth: 80,
width: 80,
allowBlank : true,
minValue : 0
}
}, {
xtype: 'numbercolumn',
dataIndex: 'geimj_8_d',
align: 'center',
width: 85,
header:'<div style=" text-align: center; vertical-align: middle;">D</div>',
text: 'D',
editor : {
xtype : 'numberfield',
maxWidth: 80,
width: 80,
allowBlank : true,
minValue : 0
}
}, {
xtype: 'numbercolumn',
dataIndex: 'geimj_8_e',
align: 'center',
width: 85,
header:'<div style=" text-align: center; vertical-align: middle;">E</div>',
text: 'E',
editor : {
xtype : 'numberfield',
maxWidth: 80,
width: 80,
allowBlank : true,
minValue : 0
}
}, {
xtype: 'numbercolumn',
dataIndex: 'geimj_8_f',
align: 'center',
width: 85,
header:'<div style=" text-align: center; vertical-align: middle;">F</div>',
text: 'F',
editor : {
xtype : 'numberfield',
maxWidth: 80,
width: 80,
allowBlank : true,
minValue : 0
}
}]
}, {
xtype: 'actioncolumn',
align: 'center',
width:30,
items: [{
cls : "x-btn-text-icon",
icon: '../images/extjs/application_edit.png',
tooltip: '编辑',
handler: function(haomgl_grid, rowIndex, colIndex) {
var date = Ext.getCmp('statdate').getValue();
var nowdate = new Date();
var year = nowdate.getFullYear();
var month = nowdate.getMonth();
var day = nowdate.getDate();
var currentdate = new Date(year, month, day);
if(date >= currentdate){
rowEditingGeimj.startEdit(rowIndex, 0);
}
}
}]
}]
});
Extjs之rowEditing编辑状态时列不对齐的更多相关文章
- jqgrid 让隐藏的列在编辑状态时出现且可编辑
有时,我们需要隐藏一个列数据,但在启动编辑时又能够被编辑. 1.设置列为编辑:editable: true 2.设置 editrules属性值为: edithidden: true colModel: ...
- iOS tableview上textView在编辑状态时,tableview自动上移的功能
在viewcognroller中,添加tableview时, tableview中cell上的textField如果吊起键盘时,tableview时可以自动上移,但是如果是textView吊起键盘,t ...
- DataGridView在Cell编辑状态响应回车键下的KeyPress/KeyDown/KeyUp事件
我们知道由于DataGridView的单元格DataGridCell处于编辑的时候,当你按Enter键,那么DataGridView是不会激发KewPress/KeyDown/KeyUp这些事件的,因 ...
- DataGridView的DataGridViewComboBoxColumn列点击一次,自动处于编辑状态
本文转载:http://www.cnblogs.com/Johnny_Z/archive/2012/02/12/2348235.html Winform中的DataGridView数据绑定控件有时会用 ...
- easyui 在编辑状态下,动态修改其他列值。
首先是自定义了一个方法uodateColumn更新列值 /** *自定义的修改列值方法 */ $.extend($.fn.datagrid.methods, { updateColumn: funct ...
- 速成KeePass全局自动填表登录QQ与迅雷(包括中文输入法状态时用中文用户名一键登录)
原文:http://bbs.kafan.cn/thread-1637531-1-1.html 使用目的:1 网页和本地客户端登录一站式解决2 通过KeePss修改密码和登录更方便,可以复制粘贴,省了输 ...
- jqgrid 批量启动所有行为可编辑状态
有时,为操作方便,需要将jqgrid表格设置为一直处于编辑状态,用户只需要在对应的编辑区填写自己信息,不再频繁的去触发行编辑和保存. 参考代码如下: //$gridCase为传入jqgrid对象 fu ...
- 在DBGrid中可选中行而又可进入编辑状态
如何在DBGrid中选中行,而又让它可以进入编辑状态? 也许你会问我这有什么用?呵呵,做数据库应用的兄弟们会深有感触,当用DBGrid显示的字段过多时,用户不得不拉动最下面的滚动条,去看最右边的东西, ...
- Devexpress WinForm GridControl实现单元格可编辑状态更改
之前做项目的时候,需要实现这样的功能.在gridcontrol中,根据是否修改(checkbox)列的选中和未选中状态来联动另外一列的编辑状态.实现如下: private void gridView1 ...
随机推荐
- Minimum Size Subarray Sum —— LeetCode
Given an array of n positive integers and a positive integer s, find the minimal length of a subarra ...
- 使用vs2010编译 Python \ SIP \ PyQt4
(1)先使用vs2010编译 Python http://www.cnblogs.com/fortwo/archive/2013/04/16/3023871.html 注意,若编译的为debug版的P ...
- 《A First Course in Probability》-chaper8-极限定理-各类不等式
詹森不等式: 证明:
- Atom 编辑器 前端基本插件
Atom 编辑器插件 这个编辑器是github出品,现在处于免费试用期:如果是初学者,可以使用这个编辑器,插件安装很方便,只需要点菜单栏的File-Settings-Install,在搜索框中输入想要 ...
- static作用——The static effect
1)在函数体内,一个被声明为静态的变量在这一函数被调用过程中维持其值不变(该变量存放在静态变量区). 2) 在模块内(但在函数体外),一个被声明为静态的变量可以被模块内所用函数访问,但不能被模块外其它 ...
- android 怎样内置/预置/预编译文件(运行程序,应用程序,apk, jar, lib 等随意文件)到系统中
方法一: 如果要内置的软件名称为iperf.exe 1. 将iperf.exe放到Codebase的随意一个文件夹下(该文件夹必须可以在搜索Android.mk时被搜索到),比方system/ipe ...
- C++通过WIN32 API获取逻辑磁盘详细信息
众所周知,在微软的操作系统下编写应用程序,最主要的还是通过windows所提供的api函数来实现各种操作的,这些函数通常是可以直接使用的,只要包含windows.h这个头文件. 今天我们主要介绍的 ...
- 各种div+css居中方式调整(转载)
盘点8种CSS实现垂直居中水平居中的绝对定位居中技术 分类: 前端开发2013-09-11 21:06 24959人阅读 评论(3) 收藏 举报 绝对居中垂直居中水平居中CSS居中代码 目录(?) ...
- [转] 使用memc-nginx和srcache-nginx模块构建高效透明的缓存机制
为了提高性能,几乎所有互联网应用都有缓存机制,其中Memcache是使用非常广泛的一个分布式缓存系统.众所周知,LAMP是非常经典的Web架构方式,但是随着Nginx的 成熟,越来越多的系统开始转型为 ...
- 初学 Canvas <第一篇-基础篇>
本文摘自:兴趣部落大神(为你一生画眉)-讲一讲canvas究竟是个啥? HTML5 的标准已经出来好久了,但是似乎其中的 Canvas 现在并没有在太多的地方用到.一个很重要的原因是,Canvas 的 ...