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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:37:10+00:00 2026-05-27T03:37:10+00:00

The goal is to apply one cls to column, which I did with getRowClass

  • 0

The goal is to apply one cls to column, which I did with getRowClass and then remove it after 1-2 sec. The websync is pushing new data every 5 seconds, so when this changes to cell appear, it should be like a blink of a changed column(cell), that goes back to “white”(default) before new data refresh? The value assigned to compare new records with is 0, but in a real case is last value that is being compared!
Here is my code:

Ext.create('Ext.grid.Panel', {
    columns: [
    // ...
    {
        header: 'Change',
        dataIndex: 'change',
        tdCls: 'x-change-cell'
    }
    // ...
    ],

    viewConfig: {
        getRowClass: function (record, index) {
            var c = record.get('change');
            if (c < 0) {
                return 'price-fall';
                //   I tried setTimeout("remove-css()",1000); and
                //    Ext.Function.defer(remove-css, 1000);
                //     but no luck!!
            } else if (c > 0) {
                return 'price-rise';
            }
        }
    }
    // ...
});    

CSS:

.price-fall .x-change-cell {
    background-color: #FFB0C4;
    color:red;
}
.price-rise .x-change-cell {
    background-color: #B0FFC5;
    color:green;
}

Any ideas?

  • 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-27T03:37:11+00:00Added an answer on May 27, 2026 at 3:37 am

    Try something like that:

    store.on('add', function() {
        var els = Ext.select('.price-fall', this.getEl());
        els.each(function(el) {
            el.removeCls('price-fall');
        });
        els = Ext.select('.price-rise', this.getEl());
        els.each(function(el) {
            el.removeCls('price-rise');
        });
    }, grid, { delay: 2000 });
    

    Here the add event is fired with 2sek delay.

    And I’ve found another solution:

    getRowClass: function(rec, index) {
        if (rec.get('rendered') === undefined) {
            Ext.Function.defer(function() {
                this.removeRowCls(index, 'price-fall');
                this.removeRowCls(index, 'price-rise');
                rec.set('rendered', true); // mark row, in case there repaint occur
            }, 2000, this);
    
            if (rec.get('change') < 0) {
                return 'price-fall';
            } else {
                return 'price-rise';
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm quite new to sencha touch. The goal is to create an app which
Goal: to create a percentage column based off the values of calculated columns. Here's
Is it possible to apply one CSS declaration to more than one HTML element
This is for the Apple platform. My end goal is to do a find
Goal : I wants when I drag image it become fade so we can
Goal is to make a dialog that appears on menu_key pressed, but it keeps
Goal: Once i click on the start button on my user interface, i currently
Goal: Produce an Excel document with information from 3 associated models that is similar
Goal I am building an Eclipse plugin targeting the 3.7 environment and would like
GOAL : To customize the background view of cell. Here is what I am

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.