There is a need to dynamically change the appearance in the ExtJS 4 panel.
By default, the grid is displayed in the form of a table, but in my application I need a function to switch the grid from the table view to the tile (or map). Below I tried to imagine how it should look.
Normal view: Tiles view: ====================================== ==================================== | Name | Description | | Name | Description | ====================================== ==================================== | Name 1 | First description |^| | ------ ------ ------ |^| |----------------------------------|X| | | OO | | @ @ | | > < | |X| | Name 2 | Second description |X| | | \__/ | | \__/ | | \__/ | |X| |----------------------------------|X| | ------ ------ ------ |X| | Name 3 | Third description | | | Name 1 Name 2 Name 3 | | |----------------------------------| | | | | | | | | | ------ ------ ------ | | | ... | ... |v| | | o O | | - - | | * * | |v| ====================================== ====================================
I found an almost perfect implementation of what I need with the name Ext.ux.grid.ExplorerView . However, the extension was developed for ExtJS version 2.x (3.x) and cannot be reused for ExtJS 4.
I use a grid that is created as simple as:
Ext.create("Ext.grid.Panel", { store: ..., columns: [{ header: "Name", dataIndex: "name", }, { header: "Description", dataIndex: "description" }], tbar: [ ... ], bbar: [ ... ], listeners: { ... }, multiSelect: true, viewConfig: { stripeRows: true, markDirty: false, listeners: { ... } } });
I tried to update the tpl property of the internal view component, but nothing works.
Do you have any idea on how to make a dynamic switch between views for one grid panel?
source share