【问题标题】:Numbering Grid Rows in Ext JS Ext.grid.panelExt JS Ext.grid.panel 中的网格行编号
【发布时间】:2013-06-10 20:11:44
【问题描述】:

我正在尝试使用我的网格获取编号的行。

var grid = Ext.create('Ext.grid.Panel',
    {

我查看了 Ext JS 中的 Grids 文档,但是,我找不到编号属性。对我有什么想法吗?

这是我的专栏部分。列中的信息是从服务器中提取的。

columns:
        {
            xtype: 'rownumberer',
            defaults:
            {
                align: 'center',
                flex: 0,
                width: 40,
                sortable: false,
                menuDisabled: true
            },
            items:
                [

【问题讨论】:

    标签: extjs grid


    【解决方案1】:

    使用RowNumberer 列类型。

    编辑:

    您必须添加此类型的额外列。示例:

    Ext.widget('grid', {
        columns: {
            defaults: {
                // you column defaults
            },
            items: [{
                xtype: 'rownumberer' // this is a column type
            },{
                dataIndex: 'foo'
                ,text: 'Column Foo'
            },{
                dataIndex: 'bar'
                ,text: 'Column Bar'
            }]
        }
    
        // ...
    })
    

    【讨论】:

    • 我已经尝试过了,但它不起作用。这是我的专栏部分。
    • 你必须为rownumberer添加一列,我用一个例子更新了我的答案。
    猜你喜欢
    • 2011-10-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多