How to update gridview in extjs?

I use gridview, which dynamically binds data from a data store. I have two text fields for entering data into the grid. On the submit button, click the text field data that I add to my data warehouse (no need to store in the backend). Now I want to update the gridview using the data store.

My code is:

_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(); }, 

Now how to update my gridview?

Please help me...

+6
source share
2 answers

Ext.grid.GridView has a refresh () method.

 this._grid.getView().refresh(); 
+13
source

I believe an update feature like this one (untested) will work for Extjs 4;

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

Source: https://habr.com/ru/post/911751/


All Articles