Get column value in gridPanel on row selected in Handler

Page 1 of 2 12 LastLast
  1. #1

    Get column value in gridPanel on row selected in Handler

  2. #2
    I forget to say that my first column of my gridPanel is checkbox.
    Moreover the result of my function give "{\"row\":2,\"column\":0}" for string gridPanelId
  3. #3
    Hi @Cismik,

    Do you mean a specific column of a selected row? Or a cell? Are you using a CellSelectionModel?
  4. #4
    Thanks for reply,
    I have a column name ID and I don't use CellSelectionModel

    Exemple of adding colum :

                    
                    foreach (var field in fieldList)
                    {
                        Ext.Net.Column column = new Column() { ID = field.Name + currentId, Text = field.Name, DataIndex = field.Name };
                        gridPanel.ColumnModel.Columns.Add(column);
                    }
  5. #5
    Probably, you should use a record's get method:
    record.get("column's dataIndex");
    or a record's data property:
    record.data.columnDataIndex
  6. #6
    I try :

    string.Format("App.direct.EditGridElement(this.id, (#{{{0}}}.record.get('{1}') );", gridId, "ID");
    Result:
    Unable to get the value of the "get" property: object null or undefined

    And :

    string.Format("App.direct.EditGridElement(this.id, (#{{{0}}}.record.data.{1} );", gridId, "ID");
    Result:
    Unable to get the value of the "data" property: object null or undefined
  7. #7
    I doubt that a record is passed to a Button's handler. By the way, where is that Button?

    Also what a row you need to get a column value of? Is that a selected row?
  8. #8
    the button is on a pagingToolbar on a gridPanel.
    And yes, it's a selected row which I want to get values

    thanks for reply
  9. #9
    Then
    var sm = grid.getSelectionModel(),
         value = null;
    
    if (sm.hasSelection()) {
       value = sm.getSelection()[0].get("columnDataIndex");
    }
    
    App.direct.SomeDirectMethod(value);
  10. #10
    Last edited by Cismik; Jun 25, 2013 at 4:23 PM.
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 6
    Last Post: Sep 21, 2011, 9:37 AM
  2. Handler/Fn for column (code behind)
    By roszman in forum 1.x Help
    Replies: 1
    Last Post: Apr 28, 2010, 4:36 AM
  3. [CLOSED] [1.0] Column Renderer Format/Handler
    By state in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 24, 2010, 6:49 PM
  4. [CLOSED] [1.0] Gridview Editor Column handler
    By ljankowski in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jan 27, 2010, 7:49 AM
  5. Replies: 2
    Last Post: Dec 25, 2009, 2:56 PM

Tags for this Thread

Posting Permissions