Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8743509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:41:27+00:00 2026-06-13T11:41:27+00:00

There is a need to dynamically change a view in ExtJS 4 grid panel

  • 0

There is a need to dynamically change a view in ExtJS 4 grid panel.

By default grid is displayed as a table, but in my application I need a feature to switch grid from table view to tiles (or cards) view. Below I tried to represent how it should look like.

 Normal view:                               Tiles view:
 ======================================     ====================================
 | Name       | Description           |     | Name       | Description         |
 ======================================     ====================================
 | Name 1     | First description   |^|     |  ------     ------     ------  |^|
 |----------------------------------|X|     | | O  O |   | @  @ |   | >  < | |X|
 | Name 2     | Second description  |X|     | | \__/ |   | \__/ |   | \__/ | |X|
 |----------------------------------|X|     |  ------     ------     ------  |X|
 | Name 3     | Third description   | |     |  Name 1     Name 2     Name 3  | |
 |----------------------------------| |     |                                | |
 |            |                     | |     |  ------     ------     ------  | |
 | ...        | ...                 |v|     | | o  O |   | -  - |   | *  * | |v|
 ======================================     ====================================

I have found almost perfect implementation of what I need, named Ext.ux.grid.ExplorerView. However, the extension was developed for ExtJS versions 2.x (3.x), and cannot be reused for ExtJS 4.

I use a grid which 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 have tried to update tpl property of the inner view component, but nothing seems to work.

Do you have any idea of how to make the dynamic switch between the views for a single grid panel?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:41:27+00:00Added an answer on June 13, 2026 at 11:41 am

    The problem was easily solved with wonderful feature for grid panel named “Tileview” developed by Harald Hanek. The solution was specially developed for ExtJS 4.

    The basic usage example is:

    var grid = 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: { ... }
        },
    
        features: [Ext.create("Ext.ux.grid.feature.Tileview", {
            getAdditionalData: function(data, index, record, orig) {
                if (this.viewMode) {
                    return {
                        name: record.get("name").toLowerCase(),
                    };
                }
                return {};
            },
            viewMode: 'tileIcons',   // default view
            viewTpls: {
                tileIcons: [
                    '<td class="{cls} ux-tileview-detailed-icon-row">',
                    '<table class="x-grid-row-table">',
                        '<tbody>',
                        '<tr>',
                            '<td class="x-grid-col x-grid-cell ux-tileview-icon" style="background-image: url(&quot;...&quot;);">',
                            '</td>',
                            '<td class="x-grid-col x-grid-cell">',
                                '<div class="x-grid-cell-inner">{name}</div>',
                            '</td>',
                        '</tr>',
                        '</tbody>',
                    '</table>',
                    '</td>'
                ].join(""),
    
                mediumIcons: [ ... ].join(""),
                largeIcons: [ ... ].join("")
            }
        })]
    });
    

    To change the view we should just use setView() method, i.e.

    grid.features[0].setView("tileIcons");
    

    That’s how the feature looks like in the real life.

    • Example of tile view:

    enter image description here

    • Example of image view:

    enter image description here


    References:

    • https://github.com/harrydeluxe/extjs-ux/blob/master/ux/grid/feature/Tileview.js — Tileview sources
    • https://github.com/harrydeluxe/extjs-ux — All Harald’s extensions with screenshots
    • http://www.sencha.com/forum/showthread.php?183023-Thumbnails-in-Grid-with-switching-between-views — Feature discussion node on Sencha forum
    • http://harrydeluxe.github.com/extjs-ux/example/grid/tileview.html — Demo
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to dynamically change the loaded keys through a parameter. Imagine there yould
We have a system where we need to dynamically change what happens at the
I need a char array that will dynamically change in size. I do not
I need to dynamically change what List, columns, aggrgrates are shown on a WebPart...
I need to change the position of UIButton dynamically. I do this in cellForRowAtIndexPath:
I'm curious if there is a way to dynamically change the session ID from
I need to dynamically draw (star) topologies in a Java GUI application. By star
Is there any need for code with author's name added in every function or
Hi There I need to get the names and values of checkboxes that have
what I need: - there are two images: a background (large) and a proifile

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.