【问题标题】:How to refresh a GridView in Extjs?如何在 Extjs 中刷新 GridView?
【发布时间】:2012-03-27 12:25:58
【问题描述】:

我正在使用一个网格视图,它动态绑定来自数据存储区的数据。 我有两个文本框可以将数据输入到网格中。 在提交按钮上单击我添加到我的数据存储区的文本框数据(无需存储在后端)。 现在我想用数据存储刷新我的gridview。

我的代码:

_createEmptyRecord: function () {

var emptyrecord = Ext.data.Record.create(["id", "name", "type"]);

        return new emptyrecord({
            formula_id: 1,
            name: Amit,
            type: anything
        });
    },


    _addValuetogrid: function () {
        var record = this._createEmptyRecord();
        this._store.insert(0, record);
    },
_refreshgrid: function()
{

this._grid._addValuetogrid();

},

现在如何刷新我的 Gridview ?

请帮帮我...

【问题讨论】:

  • 大写锁坏了?
  • 请不要大喊(这次我已经为你修好了)

标签: javascript extjs3


【解决方案1】:

Ext.grid.GridView 有 refresh() 方法。

this._grid.getView().refresh();

【讨论】:

    【解决方案2】:

    我相信与此类似的刷新功能(未经测试)将适用于 Extjs 4;

    _refreshgrid: function()
        {
            this._grid.getActiveView().refresh(true);
        }
    

    【讨论】:

      猜你喜欢
      • 2011-05-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-05
      • 1970-01-01
      • 2012-12-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多