【问题标题】:checkcolumn get count校验列获取计数
【发布时间】:2012-06-14 16:13:10
【问题描述】:

在表格列中,我有复选框,可以指示我是否对其进行了任何更改,我想显示在消息文本中所做的更改。例如(000 个未保存的更改)。我用过 xtype:'checkcolumn'。如何计算我在复选框中所做的更改。

{
            xtype: 'checkcolumn',
            header: 'Select',
            align:'center',
            dataIndex: 'mapped',
            flex:1,
            listeners : 
                        {
                            checkchange : function(column, recordIndex, checked) 
                                        {
                                            alert(checked);
                                            //or send a request
                                        } 
                        }

        },

【问题讨论】:

    标签: javascript extjs checkbox


    【解决方案1】:

    您可以尝试使用这四种存储方法:

    可能是这样的:

    var store = Ext.getStore('yourStore'),
        modified = store.getUpdatedRecords(),
        count = modified.lenght;
    console.log(count + ' changes made');
    

    【讨论】:

    • 请提供我的代码示例。我想在 extjs 中显示类似“000 changes made”的表头
    • 所以我猜没有修改记录?
    • 没关系,如果没有修改的记录,它会返回长度为 0 的空数组。在哪一行出现错误?
    • { xtype: 'checkcolumn', header: 'Select', align:'center', dataIndex: 'mapped', flex:1, listeners : { checkchange : function(column, recordIndex, 检查) { var store = Ext.getStore('abc'), modified = store.getUpdatedRecords(), count = modified.lenght;警报(存储); //console.log(count + '所做的更改'); } } }
    • 如果您可以在 jsfiddle.com 中创建示例,但无法使用。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-11-29
    • 2016-04-30
    • 1970-01-01
    • 2012-05-20
    • 2019-01-30
    • 2010-12-01
    • 2013-06-25
    相关资源
    最近更新 更多