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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:34:48+00:00 2026-05-29T04:34:48+00:00

I have a problem. I use extjs grid . This grid will be refreshed

  • 0

I have a problem. I use extjs grid. This grid will be refreshed every seconds.

I refresh with this function:

ND.refresh = function() {
    ND.commList.load();
}


var refreshSeconds = refreshRate * 1000;
var t = setInterval('ND.refresh()', refreshSeconds);

But when someone selected a row to highlight it it reset this selection.
How can I remember the selected row and highlight it again after refresh?

This is my grid:

var grid = Ext.create('Ext.grid.Panel', {
     autoscroll: true,
     region: 'center',
     store: ND.dashBoardDataStore,
     stateful: true,
     forceFit: true,
     loadMask: false,
     stateId: 'stateGrid',

     viewConfig: {
         stripeRows: true
     },
     columns: [{
         text: 'Vehicle',
         sortable: true,
         flexible: 1,
         width: 60,
         dataIndex: 'vehicle'
     }, {
         text: 'CCU',
         sortable: true,
         flexible: 0,
         width: 50,
         renderer: status,
         dataIndex: 'ccuStatus'
     }]
 });

Thanks guys

  • 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-29T04:34:49+00:00Added an answer on May 29, 2026 at 4:34 am

    I wrote simple Ext.grid.Panel extension that automatically selects back rows that were selected before store reload. You can try it in this jsFiddle

    Ext.define('PersistantSelectionGridPanel', {
        extend: 'Ext.grid.Panel',
        selectedRecords: [],
        initComponent: function() {
            this.callParent(arguments);
    
            this.getStore().on('beforeload', this.rememberSelection, this);
            this.getView().on('refresh', this.refreshSelection, this);
        },
        rememberSelection: function(selModel, selectedRecords) {
            if (!this.rendered || Ext.isEmpty(this.el)) {
                return;
            }
    
            this.selectedRecords = this.getSelectionModel().getSelection();
            this.getView().saveScrollState();
        },
        refreshSelection: function() {
            if (0 >= this.selectedRecords.length) {
                return;
            }
    
            var newRecordsToSelect = [];
            for (var i = 0; i < this.selectedRecords.length; i++) {
                record = this.getStore().getById(this.selectedRecords[i].getId());
                if (!Ext.isEmpty(record)) {
                    newRecordsToSelect.push(record);
                }
            }
    
            this.getSelectionModel().select(newRecordsToSelect);
            Ext.defer(this.setScrollTop, 30, this, [this.getView().scrollState.top]);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok I have this problem I'm trying to use Jquery to load a partial
I have problem with ajax loader image when I use the load() function, the
i have problem use link_to_remote link_to_remote document example say link_to_remote Delete this post, :update
I'm doing a Microsoft Surface Application and I have this problem: I use the
i have problem with load data from Database i use Primefaces (or other use
regarding to this question , i have a problem if use that query for
I have found a problem with use JQuery timeout, i have a page with
I have problem with setting proper charset on my jsf pages. I use MySql
In a couple of scripts that I use I have problem that is intermittent.
I have quite a problem concerning the use of relational database concepts in Delphi

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.