[CLOSED] Combobox with grouped items

  1. #1

    [CLOSED] Combobox with grouped items

    Hi,

    I would need a combobox that displays items grouped
    according to a certain field.

    It is something like in the attached image.

    Attachment 24809

    The selectable items must be the ones under the groups, such as "Anzahl_Ankunftsanmeldungen"
    in the example.

    How can I achieve that? I have searched in the examples and in the forums
    but I could not find a solution.

    Thank you.
    Attached Thumbnails Click image for larger version. 

Name:	combo.jpg 
Views:	130 
Size:	65.4 KB 
ID:	24810  
    Last edited by fabricio.murta; Jan 21, 2017 at 2:52 PM.
  2. #2
    Hello @alessandra.monica!

    This is not a feature ready out-of-the-box, but the way to go is basing your combo box on this example:
    - Form fields > Combo box > Custom Drop Down List

    What should be worked then would be about these lines:
    1. add the grouping field to the combobox store's model
    2. sort the store first by the group column (it could be just a number to represent each group, in the desired order)
    3. then 2nd sort order would be the description, maybe, so you get a list with grouped and ordered items
    4. (maybe the challenge would be here) if first record or the group name/id differs from previous record, then add print the row with the group name as in your screenshot
    5. format the record normally as in the example above

    As it is not a feature nor something supported out-of-the box, we don't really have a ready example on how exactly to do this. But given these directions if you still can't make it work and look as you want, please share how far you gone with it (in a simplified code sample as documented in this thread), we'll do our best to assist you!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Thank you Fabricio,

    you can close the thread!
  4. #4
    Hello! Thanks for the feedback and I'm glad we (likely) were able to help you!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 4
    Last Post: Jul 15, 2014, 10:59 AM
  2. Replies: 5
    Last Post: Mar 15, 2013, 4:24 AM
  3. [CLOSED] Problem when inserting items in grouped grid
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 24, 2012, 3:46 PM
  4. [CLOSED] ComboBox keyboard navigation for grouped results
    By prointernet in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 12, 2011, 10:35 AM
  5. [CLOSED] Combobox: How to remove the duplicate items in the combobox?
    By csssi_coolite in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 09, 2011, 9:34 AM

Posting Permissions