日期:2014-05-16  浏览次数:20323 次

求助!Extjs3.3 Grid中如何让可编辑的单元格默认视觉效果为可编辑的?有图!
Extjs3.3 Grid中如何让可编辑的单元格默认视觉效果为可编辑的?有图!

代码如下:

var apsListsContentCM = new Ext.grid.ColumnModel([
{
header : '创建者',
dataIndex : 'createUser',
align : 'center',
width : 40,
sortable : true
}, 
{
header : '创建时间',
dataIndex : 'createTime',
align : 'center',
width : 50,
sortable : true
}, 
{
header : '排序',
dataIndex : 'orderNum',
align : 'center',
width : 30,
sortable : true,
css: 'x-grid3-cell-selected',
editor : new Ext.form.NumberField({
allowBlank : false,
allowNegative : false,
minValue : 1,
decimalPrecision : 0
})
}, 
{
header : '操作',
dataIndex : 'operate',
align : 'center',
width : 70,
sortable : false
}
]);

// 定义表格
var apsListsContentGridPanel = new Ext.grid.EditorGridPanel({
style: 'text-align: left',
height : 340,
border: true,
stripeRows : true,// 斑马线效果
loadMask: {
msg: '加载数据中, 请稍侯... ...'
},
trackMouseOver: true,
store : apsListsContentJsonStore,
autoExpandColumn : 'bussId',
cm : apsListsContentCM,
sm : apsListsContentSM,
clicksToEdit : 1,// 单击编辑
viewConfig : {
scrollOffset : 20,// 滑动条宽度,默认是20
forceFit : true
}
  });


页面:


列[排序]是可以编辑的,鼠标单击之后会出现输入框,可编辑,如下图:


我想直接出现框框,不要单击再出现,不然别人不知道这一列是可编辑的,我想达到的效果是:此页面展开后,列[排序]就展现编辑框,一目了然。希望各位朋友帮忙解决,感激不敬!

------解决方案--------------------
这一列用renderer方法去渲染,返回个html标签
renderer:function(value){return "<input type='text' value='\"+value+\"'></input>"}
可能我的html写的有点问题
------解决方案--------------------
看api啊,有现成的方法,好像叫startedit()
------解决方案--------------------
我也遇到同样的问题了 ,敢问解决了吗?分享一下
------解决方案--------------------
startEditing