0

我无法让 rownumberer 计算我的行数。我只得到每一行的数字 1,而不是 1、2、3 等等。我哪里错了?谢谢您的帮助。

        var iLineItemCM = new Ext.grid.ColumnModel([
    new Ext.grid.RowNumberer(),
{
    id:'i_line_item_name',
    header: "Line Item Name",
    dataIndex: 'i_line_item_name',
    width: 280,
    editor: new Ext.form.TextArea({
        allowBlank: false
    })
}
,{
    header: "Amount",
    dataIndex: 'i_line_item_amt',
    width: 80,
    align: 'right',
    renderer: 'usMoney',
    editor: new Ext.form.NumberField({
        allowBlank: false,
        allowNegative: false,
        maxValue: 100000
    })
}
]);
4

1 回答 1

0

在使用网格面板并在运行时一次添加一条记录时,我遇到了类似的问题。行编号器从记录索引中获取数字,我必须手动告诉每条记录它的索引是什么

store.load(function(records, operation, success) {
            if (success) {
                // set the index on the record so that the rows will be numbered correctly.
                // this is a known bug in extjs when adding records dynamically
                records[0].index = me.current_count;
                me.current_count++;
                // There is only 1 compound record returned
                me.getGrid().getStore().add(records[0]);
于 2012-10-31T15:54:25.210 回答