PDA

View Full Version : Using Ext.selection.Model on custom container/components



tf@friedrich-heilmuth.de
14 Jul 2014, 3:00 AM
Hi!

IŽam working on a customized panel showing items in tiles (explorer style). The goal is to have a custom component that is more or less acting like a grid-view. Currently i am struggling a little bit how to implement the ExtJS selection model to my custom panel.

Structure of my custom panel:
tilepanel (extends Ext.panel.Panel) -> tilepanelview (extends Ext.container.Container) -> items[] (Ext.Component)

The 'tilepanel' is setup with a store. the events of the store are binded to the tilepanelview and will refresh the items inside the view.

All items inside the view will add listeners for click and double click and can be catched in a controller that uses my custom panel.

To keep the code aligned to the basic concept of ExtJS i would like to implement the Ext.selection.Model concept to my custom panel. But i am missing any documentation how to implement the selection model to a custom panel.

Can anyone give me a short overview how to add "selection" to my custom panel?

Please let me know if more information is required to give a qualified answer on my question!

Phil Guerrant
14 Jul 2014, 9:04 AM
I'd recommend extending Ext.view.View (http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.view.View) as it has built in SelectionModel integration.