Results 1 to 4 of 4

Thread: autoRender grid editor combos

  1. #1
    Sencha User
    Join Date
    Nov 2014
    Posts
    53
    Answers
    4
    Vote Rating
    0
      0  

    Default Answered: autoRender grid editor combos

    Hello all,

    I have an editable grid that has 4 editable columns. All 4 editors are comboboxes. When one combobox is selected I need to reload the other combos. Think of a Country/State/City scenario where states will reload depending on what country was selected, then the City combo will reload and so forth.

    I listen to the combo "select" event and load the other comboxes accordingly.

    The problem is, if I activate combo editor in Country column only then reload state store, I will get undefined error for the State column editor combobox since it has not yet rendered. If I manually activate all editors then invoke my "select" handler again all works fine. So there is no issue with my code.

    I tried adding autoRender: true but to no avail;

    My grid uses a card layout so can i listen for the activate event and then render all the editor combos?

    I checked the docs and saw all components have a render( ) method but how can I call that if I cant query for a component that has not yet been rendered??

    Or is it possible for me to somehow use the columns renderer function to return my comboboxes instead of the editor config?
    thank you in advance

  2. Looks like you are defining stores of comboboxes inline in combos. Just create the country, state, city stores with grids so the loading of the store/access to the combo stores will not have dependency on combo rendering. Or use Ext.create instead of xtype, then you will have access to all the methods inside. Or define your stores as global stores in the app/store directory and manage them from controller.Do you understand what I mean?

  3. #2
    Sencha User yeghikyan's Avatar
    Join Date
    Mar 2009
    Location
    München
    Posts
    574
    Answers
    99
    Vote Rating
    46
      0  

    Default

    Looks like you are defining stores of comboboxes inline in combos. Just create the country, state, city stores with grids so the loading of the store/access to the combo stores will not have dependency on combo rendering. Or use Ext.create instead of xtype, then you will have access to all the methods inside. Or define your stores as global stores in the app/store directory and manage them from controller.Do you understand what I mean?
    "The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague." – Edsger W. Dijkstra

  4. #3
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791
    Answers
    585
    Vote Rating
    394
      0  

    Default

    As yeghikyan suggests, creating the stores explicitly allows you to grab a reference to them that is not dependent on the comboboxes.

    The RowEditing plugin will ensure all the fields are rendered at once, so that could be an option.

    If you want to return the comboboxes from your renderer instead you'd need a user extension:

    http://www.sencha.com/forum/showthread.php?148064

  5. #4
    Sencha User
    Join Date
    Nov 2014
    Posts
    53
    Answers
    4
    Vote Rating
    0
      0  

    Default

    yes I was defining the stores inline. Defining the stores on the grid worked.

    Thx

Posting Permissions

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