ext editorgridpanel 能实现这样的功能吗?
我先读取了两条记录在editorgridpanel 里,
而这两条记录是不允许修改的,其它可随意添加一行,修改,删除.
唯独这两行不能修改内容,可删除.
这样的功能能实现吗?
希望各位给点方案!
等待中...
[b]问题补充:[/b]
:D 非常感谢 atian25
问题解决了,其实之前也有此思路,因为比较急所以没有去实践.
看来以后有了理论之后要多实践.
以下是我的代码:
.......
listeners : {
beforeedit : function(obj){
if(obj.row==0){
return false;
}
}
}
.......
监听grid的beforeedit事件,判断record是不是你需要的那2条,如果是,return false就可以把编辑事件取消掉.
beforeedit : ( Object e )
Fires before cell editing is triggered. The edit event object has the following properties
grid - This grid
record - The record being edited
field - The field name being edited
value - The value for the field being edited.
row - The grid row index
column - The grid column index
cancel - Set this to true to cancel the edit or return false from your handler.
Listeners will be called with the following arguments:
e : Object
An edit event (see above for description)