[CLOSED] Get Row Number in Code Behind using RowNumbererColumn

  1. #1

    [CLOSED] Get Row Number in Code Behind using RowNumbererColumn

    Is there a way to bind RowNumbererColumn to the Store and send it to the server?
    I need this value in order to show error messages from code behind


    I've tried the traditional way and is not working. (Always return 0 in JSON)

    <ext:RowNumbererColumn ColumnID="RowNumber" DataIndex="RowNumber"/>
    Thanks
    Last edited by Daniil; Feb 28, 2012 at 7:07 PM. Reason: [CLOSED]
  2. #2
    Hi,

    There is no DataIndex of RowNumbererColumn. It just internally uses the following Renderer:
    renderer : function(v, p, record, rowIndex){
        if(this.rowspan){
            p.cellAttr = 'rowspan="'+this.rowspan+'"';
        }
        return rowIndex+1;
    }
    You should manage indexes manually setting up a separate RecordField for that.

    If you'd provide more details about the requirement posting a sample, we could suggest something.
  3. #3
    I've found a solution a simple, in the afteredit event I set the rowNumber to a new store field.
    Then I use it in the code behind.

      var afterEdit = function (e) {
               e.record.beginEdit();
               e.record.set('RowNumber', e.row + 1);
               e.record.endEdit();
    }
    Thanks.

    Quote Originally Posted by Daniil View Post
    Hi,

    There is no DataIndex of RowNumbererColumn. It just internally uses the following Renderer:
    renderer : function(v, p, record, rowIndex){
        if(this.rowspan){
            p.cellAttr = 'rowspan="'+this.rowspan+'"';
        }
        return rowIndex+1;
    }
    You should manage indexes manually setting up a separate RecordField for that.

    If you'd provide more details about the requirement posting a sample, we could suggest something.

Similar Threads

  1. [CLOSED] Set the page number on GridPanel from code behind
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 02, 2012, 8:18 PM
  2. Replies: 2
    Last Post: Sep 26, 2011, 10:23 AM
  3. Replies: 0
    Last Post: Aug 30, 2011, 2:48 PM
  4. [CLOSED] [1.0] RowNumbererColumn
    By state in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Apr 05, 2010, 8:19 PM
  5. How to validate Fax, Phone number and zip code?
    By flormariafr in forum 1.x Help
    Replies: 5
    Last Post: Jan 22, 2010, 3:46 PM

Posting Permissions