• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

[SOLVED] How can you use a store field name to get it's grid column heading text?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [SOLVED] How can you use a store field name to get it's grid column heading text?

    I have a grid with hidden fields and need to display all the fields in a given record that a user will select. Since the some of the fields are hidden, the are not in the view object at the time the user selects the row.

    I need the column headings for those fields to display in a window that I will create onrightclick.

    is there a way to use the store field name to find the column heading for it in the grid? I can't figure it out.
    Code:
    onRightClickIndexItem: function(view, record, el, index, event) {
    		event.stopEvent();
    		this.currentRecord = record;
    		this.gridcolumns = view.getGridColumns();  //<------no hidden fields in here
    		this.gridindex = index;
    		this.getIndexGrid().menu.showAt(event.getXY());
    }
    
    I know I can get the field names by doing:
    var store = this.getStore('Rvabreps');
    var fields = store.model.fields.keys;
    
    and then I can do a loop to get the data
    for (var i = 0; i < fields.length; i++) {
       var fieldname = fields[i];
       var value = record.get(fields[i]);
       var fieldlabel = ?????? (grid.column.text)
    
       detailform.add({
          fieldLabel: fieldlabel,
          value: value,
          xtype: 'displayfield'
    });
    }

  • #2
    grid.getView().getHeaderCt().child('[componentquery]')

    http://docs.sencha.com/extjs/4.1.3/#...r-method-child

    Comment


    • #3
      Thanks! I'll give that a try

      Comment

      Working...
      X