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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T20:45:00+00:00 2026-06-18T20:45:00+00:00

As shown in ext.net examples, this is code to format a column-entry var template

  • 0

As shown in ext.net examples, this is code to format a column-entry

var template = '<span style="color:{0};">{1}</span>';

var change = function (value) {
   return String.format(template, (value > 0) ? "green" : "red", value);
};

now my question is, i want to format column company likewise.

var company = function(value) {
   return String.format(template, (record.data.change > 0) ? "green" : "red", value);
}; 

this did not work as record will not be given to the function, also i failed to pass a parameter to Fn called on renderer

var company = function(value, change) {
   return String.format(template, (change > 0) ? "green" : "red", value);
}; 

i could also imagine a workaround with jquery, but that’s just a whole bunch of work and selectors. and as i am quite new to ext.net / extjs i am sure i overlooked something

P.S. yes i am using the older version of ext.net, thus the link is to examples1.ext.net 😉

  • 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-18T20:45:01+00:00Added an answer on June 18, 2026 at 8:45 pm

    You should always take a look at the ExtJS API. Here you would looking for Ext.grid.column.Column-cfg-renderer

    The renderer arguments are

    • value : Object
      The data value for the current cell
    • metaData : Object
      A collection of metadata about the current cell; can be used or modified by the renderer. Recognized properties are: tdCls, tdAttr, and style.
    • record : Ext.data.Model
      The record for the current row
    • rowIndex : Number
      The index of the current row
    • colIndex : Number
      The index of the current column
    • store : Ext.data.Store
      The data store
    • view : Ext.view.View
      The current view

    so I guess this should work for you

    var company = function(value, meta, record) {
       return String.format(template, (record.data.change > 0) ? "green" : "red", value);
    }; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to create a simple two column combobox as shown at http://examples.ext.net/#/Form/ComboBox/Two_Columns/ from the
I've created a panel bundled with an Ext.Template. This panel is contained in another
I have seen Ext.net's examples site in which each new page is added as
I've found tutorials for ASP.NET MVC4 Razor and examples for Ext.Net Webforms , and
I use Ext.form.ComboBox in very similar way as in this example: http://extjs.com/deploy/dev/examples/form/forum-search.html What annoys
In the below shown html i have this main div as cxfeeditem feeditem and
I am using Ext.Net community version 2.0.0 special Turkish characters** displays wrong. special Turkish
How to change the code so that combobox shows the list of ​​displayField values
I have this type of exercise in jquery. Go here http://jsfiddle.net/LAntL/3/ For Item 1
This PHP code below will take an image and add the word _thumb in

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.