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

      0  

    Default Remote ComboBox on a Grid

    Remote ComboBox on a Grid


    Hi,

    I have the requirements of having a combo in a grid. This combo must be remote, since its values may change depending on another value of the Bean Model.

    For example, lets say that grid lists school subjects, and in a combo we must select a teacher for each subject. But combo musn't display every teacher, only those who can give that subject.

    So I need a remote combo for an entity (Teacher), but each row will have different values for same combo (they depend on SubjectID column).

    Any suggestions?

    ¡Thanks a lot!

  2. #2
    Sencha User
    Join Date
    Oct 2012
    Posts
    2
    Vote Rating
    0
    JuanF is on a distinguished road

      0  

    Default


    This is what I finally did, maybe is usefull for someone.

    I introduced two fields,
    Code:
    private ComboBox<TeacherComboCustom> teachersCombo
    mapSubjectIdListOfTeachers Map<String,List<TeacherComboCustom>>
    in which key is subject, and value is a list of elements (Teachers) that may give that subject.

    I also introduced a Renderer to the Teacher Column, where it looks into the map if that subject has already teachers. If it has not, calls an RPC method, and on the onSucess method for that call, introduces new values into mapSubjectIdListOfTeachers.

    The editor for that column, on the preProcess, cleans teachersCombo (removes all from the store), then goes to mapSubjectIdListOfTeachers to get elements to add to the store.

    Hope it helps someone. Not very proud of what have I done, but works fine!