1. #1
    Sencha Premium Member
    Join Date
    Feb 2014
    Posts
    3
    Vote Rating
    0
    sencha@safira.pt is on a distinguished road

      0  

    Default Unanswered: Exclusive Fieldset selection

    Unanswered: Exclusive Fieldset selection


    Hi all,

    Our team needs to build a view that contains two fieldsets connected to the same store.
    The problem is that we need to have a kind of exclusive choice on the store items. For example:
    Consider we have a store with {'one', 'two', 'three','four'} named 'numbers'.
    In the view we have two fieldsets (f1 and f2) connected to 'numbers'.
    Now we need to keep some properties:
    - if f1 selects 'one', than this option must not be available in f2 (and vice-versa)
    - after f1 selects a value and on successive user taps, that same value should be available to choose

    I've been looking for anything that would implement this in sencha docs with no success. So the question is if there is any way to implement using some sencha component or not.
    Thank you!

  2. #2
    Sencha Premium Member alexander.urban's Avatar
    Join Date
    Nov 2013
    Posts
    95
    Vote Rating
    7
    Answers
    3
    alexander.urban is on a distinguished road

      0  

    Default


    Let me just do some wild-guessing: You select the record to show in F1/F2 via two selectfields called f1sel/f2sel, which use two different stores (with the same content).

    In this case:
    Code:
    f1sel.on('change',function() {
        f2sel.getStore().filterBy(function(item){
            return item.get("value")!=f1sel.getValue();
        });});
    f2sel.on('change',function() {
        f1sel.getStore().filterBy(function(item){
            return item.get("value")!=f2sel.getValue();
        });
    });
    This way, the one selected in one selectfield is removed from the store of the other selectfield.

Thread Participants: 1