Results 1 to 3 of 3

Thread: Reconfigure grid - xtype:'numbercolumn' doesn't work

  1. #1
    Sencha User
    Join Date
    May 2010
    Location
    Belgium
    Posts
    216
    Answers
    4

    Default Answered: Reconfigure grid - xtype:'numbercolumn' doesn't work

    Hello,

    I'm doing a reconfigure of my grid by doing this:

    Code:
    	
    var __columns = [];	
    for (i=0;i<numberOfYear;i++){
    	currentYear = parseInt(startingYear) + i;
    						
    	idCol = 'columnTraps_'+ currentYear;
    						   
    	var item = Ext.create ('Ext.grid.column.Column', {
    	        dataIndex: currentYear,
    	        text: currentYear,
                    id : idCol,
    	        width: 65,
    	        xtype: 'numbercolumn', 
                   format:'0.00'
        	   });
    					
    __columns.push (item); 
      
    }
     grid.reconfigure(store,__columns);
    It's properly done except the format of my number where 'xtype:"numbercolumn" doesn't seem to work.

    Anyone has already had this issue?

    Thanks in advance,

    Marxan

  2. Quote Originally Posted by marxan View Post
    It's properly done except the format of my number where 'xtype:"numbercolumn" doesn't seem to work.
    No, it's not properly done.

    First, with Ext.create(), you're specifying a class name. So xtype is irrelevant. Second, Ext.grid.column.Column is not Ext.grid.column.Number. If you want a number column, use the latter.

  3. #2
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    Raleigh, NC
    Posts
    448
    Answers
    23

    Default

    Quote Originally Posted by marxan View Post
    It's properly done except the format of my number where 'xtype:"numbercolumn" doesn't seem to work.
    No, it's not properly done.

    First, with Ext.create(), you're specifying a class name. So xtype is irrelevant. Second, Ext.grid.column.Column is not Ext.grid.column.Number. If you want a number column, use the latter.

  4. #3
    Sencha User
    Join Date
    May 2010
    Location
    Belgium
    Posts
    216
    Answers
    4

    Default thanks!

    thanks for your answer.

Posting Permissions

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