- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的 checkColumn 的 checkchange 监听器不起作用。任何想法为什么不呢?
var checked = new Ext.grid.CheckColumn({
header: 'Test',
dataIndex: 'condition',
renderer: function(v,p,record){
var content = record.data['info'];
if(content == 'True'){
p.css += ' x-grid3-check-col-td';
return '<div class="x-grid3-check-col'+(v?'-on':'')+' x-grid3-cc-'+this.id+'"> </div>';
}
},
listeners:{
checkchange: function(column, recordIndex, checked){
alert("checked");
}
}
});
最佳答案
在 Ext.ux.grid.CheckColumn 中,添加这个注册 checkchange 事件的初始化方法:
initComponent: function(){
Ext.ux.grid.CheckColumn.superclass.initComponent.call(this);
this.addEvents(
'checkchange'
);
},
processEvent : function(name, e, grid, rowIndex, colIndex){
if (name == 'mousedown') {
var record = grid.store.getAt(rowIndex);
record.set(this.dataIndex, !record.data[this.dataIndex]);
// Fire checkchange event
this.fireEvent('checkchange', this, record.data[this.dataIndex]);
return false; // Cancel row selection.
} else {
return Ext.grid.ActionColumn.superclass.processEvent.apply(this, arguments);
}
},
Ext.ns('Ext.ux.grid');
Ext.ux.grid.CheckColumn = Ext.extend(Ext.grid.Column, {
// private
initComponent: function(){
Ext.ux.grid.CheckColumn.superclass.initComponent.call(this);
this.addEvents(
'checkchange'
);
},
processEvent : function(name, e, grid, rowIndex, colIndex){
if (name == 'mousedown') {
var record = grid.store.getAt(rowIndex);
record.set(this.dataIndex, !record.data[this.dataIndex]);
this.fireEvent('checkchange', this, record.data[this.dataIndex]);
return false; // Cancel row selection.
} else {
return Ext.grid.ActionColumn.superclass.processEvent.apply(this, arguments);
}
},
renderer : function(v, p, record){
p.css += ' x-grid3-check-col-td';
return String.format('<div class="x-grid3-check-col{0}"> </div>', v ? '-on' : '');
},
// Deprecate use as a plugin. Remove in 4.0
init: Ext.emptyFn
});
// register ptype. Deprecate. Remove in 4.0
Ext.preg('checkcolumn', Ext.ux.grid.CheckColumn);
// backwards compat. Remove in 4.0
Ext.grid.CheckColumn = Ext.ux.grid.CheckColumn;
// register Column xtype
Ext.grid.Column.types.checkcolumn = Ext.ux.grid.CheckColumn;
关于Extjs 3.4 checkchange 监听器不适用于 Checkcolumn,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12390716/
我一直在 sencha 论坛以及堆栈溢出中寻找解决方案。我无法找到这个问题的正确解决方案。我想在该行中检查列的 checkchange 事件上编辑网格中某行的特定单元格。 以下是代码-
我的 checkColumn 的 checkchange 监听器不起作用。任何想法为什么不呢? var checked = new Ext.grid.CheckColumn({ header: '
我有一个扩展标准 asp.net gridview 控件的自定义 gridview 控件。 gridview 的第一列由动态创建的复选框字段组成。我在 OnRowDataBound 事件期间为复选框的
我的应用程序中有 16 个单选按钮..我必须根据选择的变量设置一个变量..我已经为此生成了一些非常丑陋的代码.. private void Foo_CheckedChanged(object send
我有一个包含复选框和文本框的用户控件: 在 Page_Load 上,我将其中的几个动态添加到页面上的面板中: //loop through the results from DB foreac
在我的项目中的一个页面中,我正在创建一个复选框,并在复选框检查更改时执行一些服务器端任务。我想要的是在转到后面的代码之前显示一条确认消息。 如果我调用 Javascript 函数,它会返回 true/
我在互联网上搜索如何在 RadioGroup 上执行新的很酷的 android 数据绑定(bind),但我没有找到一篇关于它的博客文章。 这是一个简单的场景,基于所选的单选按钮,我想使用 androi
请告诉我在 CheckBox 的 CheckChanged 事件中使用参数 e 作为 System.EventArgs 最佳答案 你可以忽略这个。 所有事件都具有相同的签名:void handler(
我有一个 TreePanel。树中的每个节点都有一个 ID。单击一个按钮,我想触发节点 2.1 的 checkchange 事件(如下图所示)。如何在单击按钮时使用其 ID 为节点触发 checkch
更清晰的解释这里是我在 .asp 上的代码文件: 在我的 .cs代码,我像这样动态地为 pnlCheckList 创建了复选框: CheckB
我是一名优秀的程序员,十分优秀!