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

  • SEARCH
  • Home
  • 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 6166345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:19:23+00:00 2026-05-23T22:19:23+00:00

I have a GridPanel that is backed by a DataStore (ExtJS 4). OK, so

  • 0

I have a GridPanel that is backed by a DataStore (ExtJS 4). OK, so when the user selects a row and clicks a delete button, I send a POST request to the server with the ID of the selected record, delete the record, and then on return, re-load the data store.

The record is deleted successfully, the server returns a status code of OK. But, if the user selects THE LAST ROW of the GridPanel, I get the following error:

Uncaught TypeError: Cannot read property ‘id’ of undefined

I have no other events on the Grid Panel or DataStore.

Here is my delete code:

function deleteTEDetailExceptions() {
   try {

      if(tedetailExceptionsEditorGrid.getSelectionModel().selected.length < 1) {
         statusMessage("Please select an exception first", true);
         return;
      }

      var record = tedetailExceptionsEditorGrid.getSelectionModel().selected.items[0];
      currentTEDetailExceptionKey = record.data["tedetailExceptionKey"];

      // send the delete request
      Ext.Ajax.request({
         url: '/timesheets/action.do',
         method: 'POST',
         params:{
            tedetailExceptionKey : currentTEDetailExceptionKey,
            type                 : "tedetailExceptions",
            "delete"             : "true"
         },
         success: function(response) {
            if(response.statusText == "OK") {
               tedetailExceptionsEditorGrid.getSelectionModel().clearSelections();
               TEDetailExceptionsStore.remove(record);

               // reload the store
               Ext.Function.defer((function(){

                  TEDetailExceptionsStore.load({
                     params:{
                        timeEntryDetailKey : timeEntryDetailKey,
                        type               : "tedetailExceptions"
                     }
                  });
               }),250);
            }
         }
      });

   }
   catch(e) {
      console.log(e);
   }
}

What am I doing wrong?

EDIT

I managed to solve the problem with the following code. It was pretty stupid of me to reload the data store when I didn’t need to!!

function deleteTEDetailExceptions() {
   try {

      if(tedetailExceptionsEditorGrid.getSelectionModel().selected.length < 1) {
         statusMessage("Please select an exception first", true);
         return;
      }

      var record = tedetailExceptionsEditorGrid.getSelectionModel().selected.items[0];
      tedetailExceptionsEditorGrid.getView().refresh();

      currentTEDetailExceptionKey = record.data["tedetailExceptionKey"];

      // send the delete request
      Ext.Ajax.request({
         url: '/timesheets/action.do',
         method: 'POST',
         params:{
            tedetailExceptionKey : currentTEDetailExceptionKey,
            type                 : "tedetailExceptions",
            "delete"             : "true"
         },
         success: function(response) {
            if(response.statusText == "OK") {
               TEDetailExceptionsStore.remove(record);
            }
         }
      });

   }
   catch(e) {
//      console.log(e);
   }
}
  • 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-23T22:19:23+00:00Added an answer on May 23, 2026 at 10:19 pm

    I’m not sure why you’re reloading the data after you’ve deleted a record. Are you using a paging toolbar as well?

    ExtJs obviously thinks that there is a record in the last row and seeing as you’re reloading all the data anyways have you tried calling TEDetailExceptionsStore.removeAll() before you reload the data store.

    Another possibility might be to refresh the grid view after you remove the record from the store. You can do this with grid.getView().refresh() This might force ExtJS into recognizing that the last row does not contain a record

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented a gridpanel using Extjs that shows the content of a database.
I just noticed that EditorGridPanel doesn't have row over effect as in GridPanel so
So if I have a gridpanel in ExtJS 4, how do I check for
I have ExtJS View-Port panel , that contain center panel, that contain tablpanel ,
I have a gridpanel that allows inline editing of a column. This column uses
Using 4.0.6 I have a gridpanel with an actioncolumn that has two items, a
I have the following extjs code that createa 2 tabs and a grid. How
I found this extjs script that create a empty gridpanel: var gridz = new
I have an ExtJS grid like so: var grid = new Ext.grid.GridPanel({ ... });
I use Extjs 4. I have grid within row expander with data from the

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.