Results 1 to 3 of 3

Thread: grid automatic computation

  1. #1
    Sencha User
    Join Date
    Nov 2010
    Posts
    80

    Default grid automatic computation

    Hi it is possible in the grid component to do some math operations automatically?
    like
    assuming that ratings are based on user inputs.
    Code:
    --------------------------------------------
      Items  | Ratings | Weights  | Score |
    --------------------------------------------
    Item A  | 4.5    (x)| 80%      =   ____|
    --------------------------------------------
    Item B  | 3      (x)|  20%     =   ____|
    --------------------------------------------
                      Total Score = ______
    can you give some idea about the computations in grid.
    help please.

  2. #2
    Sencha - Services Team
    Join Date
    Mar 2007
    Location
    Foristell, MO
    Posts
    1,121

    Default

    In your ColumnModel define a custom renderer for the column(s) that you want to have custom calculations done.

    Just take a look at the source code of the Array Grid example to get an idea of how to do custom column renders:

    http://dev.sencha.com/deploy/dev/exa...rray-grid.html

  3. #3
    Sencha User
    Join Date
    Nov 2010
    Posts
    80

    Default

    but how do I compute the total score?

    Code:
    var item = 0;
    	var tempdata = [];
    	var rec;
    	var g = Ext.getCmp('itemlist');
    	while (g.store.getAt(item)) {
    		rec = g.store.getAt(item);
    		tempdata.push(
    			new Array(
    				rec.data['score']
    				))
    		item++;
    	}
    
            tempdata + tempdata; ??

Similar Threads

  1. Automatic Scrolling Grid
    By ethraza in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 16 May 2009, 8:58 AM
  2. grid automatic mapping?
    By pex in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 15 Apr 2007, 12:06 PM
  3. Automatic calculate of grid cell?
    By canni in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 20 Jan 2007, 5:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •