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 667161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:53:52+00:00 2026-05-13T23:53:52+00:00

I have TabPanel which contains, among other things, a Grid connected to a Store.

  • 0

I have TabPanel which contains, among other things, a Grid connected to a Store.

Several events may remove elements from the store.

I would like the Grid to be removed from the TabPanel when the store is empty and, possibly, to have a single place in my code to check for this event.

I thought about using store listeners, but unfortunately this causes exceptions in Ext code.
My assumption is that this happens because rendering is performed on the grid after this is removed from the tabpanel.

Any idea on how to accomplish such a task without messing up Ext is much appreciated.
Thanks 🙂

By the way, this is a code excerpt:

var myStore = new Ext.data.Store({
 reader: new Ext.data.JsonReader({fields: MyRecord}),
 listeners:{
  'clear': function(store, recs) {
   myTabPanel.remove(myGrid);
  },
  'remove': function(store, rec, idx) {
   if (store.getCount() == 0) {
    myTabPanel.remove(myGrid);
   }
  }
 }
});

var myGrid = new Ext.grid.GridPanel({
 id: "myGrid",
 title: "A Grid",
 store: myStore,
 frame:false,
 border:false,
 columns: [
 {
  header: 'Remove',
  align:'center',
  width: 45,
  sortable: false,
  renderer: function(value, metaData, record, rowIndex, colIndex, store) {
   return '<img src="images/remove.png" width="34" height="18"/>';
  }
 },{
  header: 'Some Data',
  dataIndex: 'data',
  sortable: true
 }
 ],
 listeners:{
  'cellclick':function(grid, rowIndex, colIndex, e){
   var rec = myStore.getAt(rowIndex);
   if(colIndex == 0){
    myStore.remove(rec);
   }
  }
 } 
});

var myTabPanel= new Ext.TabPanel({ 
 activeTab: 0,
 items: [ fooPanel, barPanel, myGrid]
});
  • 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-05-13T23:53:52+00:00Added an answer on May 13, 2026 at 11:53 pm

    Problem solved: I just had to remove the grid setting the “autoDestroy” parameter to “false”.
    Fixed code below.

    var myStore = new Ext.data.Store({
     reader: new Ext.data.JsonReader({fields: MyRecord}),
     listeners:{
      'clear': function(store, recs) {
       myTabPanel.remove(myGrid, false);
      },
      'remove': function(store, rec, idx) {
       if (store.getCount() == 0) {
        myTabPanel.remove(myGrid, false);
       }
      }
     }
    });
    
    var myGrid = new Ext.grid.GridPanel({
     id: "myGrid",
     title: "A Grid",
     store: myStore,
     frame:false,
     border:false,
     columns: [
     {
      header: 'Remove',
      align:'center',
      width: 45,
      sortable: false,
      renderer: function(value, metaData, record, rowIndex, colIndex, store) {
       return '<img src="images/remove.png" width="34" height="18"/>';
      }
     },{
      header: 'Some Data',
      dataIndex: 'data',
      sortable: true
     }
     ],
     listeners:{
      'cellclick':function(grid, rowIndex, colIndex, e){
       var rec = myStore.getAt(rowIndex);
       if(colIndex == 0){
        myStore.remove(rec);
       }
      }
     } 
    });
    
    var myTabPanel= new Ext.TabPanel({ 
     activeTab: 0,
     items: [ fooPanel, barPanel, myGrid]
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JavaScript application which opens an ExtJS Window, containing an ExtJS TabPanel,
I have several USB mass storage flash drives connected to a Ubuntu Linux computer
I have a login.jsp page which contains a login form. Once logged in the
I have a tabpanel where some tabs are hidden. How can i check which
I have a tabpanel with a calendar control on the 4th tab but when
Have just started using Visual Studio Professional's built-in unit testing features, which as I
I have a JSF/RichFaces setup with an index.jsp which a4j:include s another piece of
So I have a file called WebParts.aspx which looks like this - <%@ Page
I have the following ExtJS Panel embedded in another Panel, which then resides in
I have a WPF application that mostly follows MVVM, which I am trying to

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.