data from componentColumn

  1. #1

    data from componentColumn

    Hi everybody!

    I have a GridPanel with ComponentColumn. Component of this column is FormPanel. How can i get data from form for every row of gridpanel?

    Below there is example of structure of my grid:

    
    X.GridPanel()
        .ColumnModel()
            X.ComponentColumn()
                .Component(
                    X.FormPanel()
                        .Items(
                            X.Container()
                                .Items(
                                    X.TextField()
                                    X.TextField()
                                )
                            X.Container()
                                .Items(
                                    X.TextField()
                                    X.TextField()
                                )
                        )
                )
    for example, if there are 3 elements in Store, i have 3 rows and formpanel for every row. I want get data as list of parameters from every form
  2. #2
    Hello @Bodgan!

    The text field contents probably won't be part of the grid's store, will they?..

    If so, you can just iterate thru the grid store's list of entries and collect them. Otherwise, you'd have to walk thru the grid's view entities down to every field, identifying the row to which they belong, and fetch the component's internal ID value. Then you can get the component via the method explained below.

    That'd be the case if you don't rely on the individual fields' IDs. But if otherwise you build unique text field IDs, by maybe composing the row/record ID and the field position in the cell as its id, like GridTextFieldX_rowY, you can then just write an iterate function to App.GridTextFieldX_rowY or (to avoid eval()) Ext.ComponentManager.get("GridTextField" + pos + "_row" + rownum);, where pos would be the 1..3 value of the text field and rownum the number of the corresponding row in the grid.

    Composing the IDs like this would require a renderer for the components, though; could be using BeforeBind like in the MultipleEditors example, Bind like the overview example, or try a solution involving the Column command's prepare, as highlighted by the Prepare Command example.

    Well, hope this helps!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 1
    Last Post: Apr 27, 2015, 8:53 PM
  2. ComponentColumn: Full components defined on data?
    By fabricio.murta in forum 2.x Help
    Replies: 6
    Last Post: Dec 18, 2014, 2:03 PM
  3. [CLOSED] bind ajax proxy data to ComponentColumn Combobox in a grid
    By Sowjanya in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 11, 2013, 3:01 AM
  4. [CLOSED] GridPanel - ComponentColumn - ComboBox: How to bind data??
    By jamesand in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 20, 2013, 4:28 PM
  5. How to get the ComponentColumn's value?
    By kulolo in forum 2.x Help
    Replies: 2
    Last Post: Apr 16, 2013, 1:56 AM

Tags for this Thread

Posting Permissions