1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    2
    Vote Rating
    0
    Nicklori is on a distinguished road

      0  

    Default Tree Rowediting - How to accomplish dynamic Editor interaction between cells?

    Tree Rowediting - How to accomplish dynamic Editor interaction between cells?


    Tree Rowediting - How to accomplish dynamic Editor interaction between cells?


    For example,in Tree Rowediting I have two columns each with an Editor which is a combobox. During the edit I want the changes in the combo box in column one to affect what items are displayed in the combobox of column two.


    Just for example - if the row represents a client order and I select "Man's shoe" from the shoe combo box in column one, I want the combo box in column two to show a choice of "boots,sandals". Conversely if the user selects "Woman's shoe" I need the combo box in column two to show a choice of "Clogs, slippers".


    I'm trying out extjs 4.1 which has the Ext.grid.plugin.Rowediting for Ext.tree.Panel.


    My boss has also asked to see if I can remove the two buttons on the rowedit object and just have implicit updating occur - but the interactive combobox problem is the paramount tricky one I think.


    extjs 4.1 looks to be a great toolkit, but modifying the performance of the tools and configuring them has me looking clueless and expendable. I would be very grateful for a helpful example or link to one.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,581
    Vote Rating
    433
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    You would have to get the editor of the second column and load/filter/whatever on that editor's field.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    2
    Vote Rating
    0
    Nicklori is on a distinguished road

      0  

    Default


    Thank you - by adding a listener in the "master" combo I could control the "slave" combo by clearing and resetting its filter and forcing a reload. In case it is of assistance to others the method is roughly as follows:

    listeners:{select:{fn:function(combo, value) {
    var modelCmp = Ext.getCmp('SlaveComboName');
    modelCmp.clearValue();
    modelCmp.store.removeAll();
    modelCmp.store.clearFilter();
    var byGenderType = new Ext.util.Filter({
    filterFn: function(item) {
    if (MasterComboName.getValue()=='1')
    return (item.data.filter == 'M');
    else {
    return (item.data.filter == 'W');}
    }
    });
    modelCmp.store.filters.add(byGenderType);
    modelCmp.store.load();
    modelCmp.lastQuery='';
    }}}