Reputation: 776
I would like , how to puts data in grid Panel when i clik on a tree's node ?
When , i clik on a node, it fires a itemclick events, i have model on parameters ... now, i want to "write" the data's model on my gridPanel. I want to had one line on my grid ! With a grid Panel, i must to use store , so i have tested with memory store who contains an empty data properties .. ! I thought , i can putting data on the fly in my grid ... maybe i can't !
I need helps, thanks a lot :) !
Upvotes: 0
Views: 1165
Reputation: 2966
To add data to a grid, you need to add the data to the grid's Store. There is a ton of documentation about adding new items, but you would do something like this:
var Item = grid.getStore().recordType;
var newItem = new Banner(
{
// attributes of your newItem here
// these would be the same as your Store
});
store.insert(0, newItem);
That would insert your new item as the first item in your store, and should automatically fire the grid to refresh. If it doesn't, you can manually fire a refresh by doing:
bannerGrid.getView().refresh();
Documentation for Store. Take a look at the add()
and insert()
methods.
Upvotes: 4