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 ...
随机推荐
- LNMP一键安装脚本
#!/bin/bash #LNMP(Fastcgi) #CentOS + MySQL 5.5 #-- iptables -F iptables -X iptables -Z iptables -A I ...
- POJ 2112 Optimal Milking(Floyd+多重匹配+二分枚举)
题意:有K台挤奶机,C头奶牛,每个挤奶机每天只能为M头奶牛服务,下面给的K+C的矩阵,是形容相互之间的距离,求出来走最远的那头奶牛要走多远 输入数据: 第一行三个数 K, C, M 接下来是 ...
- 数学:UVAoj 11174 Stand in a Line
Problem J Stand in a Line Input: Standard Input Output: Standard Output All the people in the bytela ...
- 后缀数组:SPOJ SUBST1 - New Distinct Substrings
Given a string, we need to find the total number of its distinct substrings. Input T- number of test ...
- 【并查集】【模拟】Codeforces 698B & 699D Fix a Tree
题目链接: http://codeforces.com/problemset/problem/698/B http://codeforces.com/problemset/problem/699/D ...
- Delphi 客户端调用Webservice 的TClientdataset 报出“http://www.borland.com/namespaces/Types-IAppServerSOAP”
http://www.borland.com/namespaces/Types-IAppServerSOAP 服务器未能识别 HTTP 头 SOAPAction 的值 (2011-04-25 16:4 ...
- 动态规划——J 括号配对问题
J - 括号匹配 Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Sta ...
- floyd详解
就不在来回搬了 请看 http://note.youdao.com/groupshare/?token=6422E952998F4381A1534B71359EFA57&gid=1579165 ...
- 【Cocos2d-X开发学习笔记】第27期:游戏背景之贴图地图类(CCTileMapAtlas)的使用
本系列学习教程使用的是cocos2d-x-2.1.4(最新版为3.0alpha0-pre) ,PC开发环境Windows7,C++开发环境VS2010 一.贴图地图类CCTileMapAtlas 除了 ...
- 根据类名查所属jar包
在开发时经常会参考一些现有的例子,但有些例子只有代码,代码中引用的类所属的jar包却没有明确说明,如何找到一个类所属的jar包,可以通过访问以下网址解决:http://www.findjar.com