【问题标题】:Count number of selected row in gridpanel extjs计算gridpanel extjs中选定行的数量
【发布时间】:2013-05-19 22:55:10
【问题描述】:

我有一个带有数据的网格面板,我可以通过store.getcount() 显示网格中的记录总数。当我点击一条记录时,我想显示所选记录的编号。

例如:

  • 记录总数为5条
  • 我点击第一行
  • 文本框将显示 1/5

【问题讨论】:

    标签: extjs count grid store


    【解决方案1】:
    grid.getSelectionModel().getCount()
    

    【讨论】:

      【解决方案2】:

      在你的网格选择监听器中试试这个:

      listeners:{
                  select: function(selModel, record, index, options) {
                      your_textfield.setValue(index+'/'+Ext.getCmp('yourGridId').store.getCount());
                  }
              }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多