1. #1
    Sencha User
    Join Date
    Aug 2009
    Posts
    96
    Vote Rating
    1
    r4nd7263 is on a distinguished road

      0  

    Default CheckBoxGroup equivalent

    CheckBoxGroup equivalent


    In GXT 2, I used CheckBoxGroup to group many CheckBoxes in one field and had a custom validator to check that at least of the checkboxes is checked.

    CheckBoxGroup is not in GXT 3, how do I do the same? I studied FieldLabel, AbstractValidator, CheckBox documents, but can't find a concrete example to help me put them together. Appreciated if anyone could point me in the right direction.

  2. #2
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    411
    Vote Rating
    21
    icfantv will become famous soon enough icfantv will become famous soon enough

      0  

    Default


    Take a look at the ToggleGroup class. I think that's what you want.

  3. #3
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    The one issue with the ToggleGroup is that it only has one active value at a time - a CheckBox group should really implement HasValue<List<T>>, where T is either CheckBox (or rather HasValue<Boolean>), or is some model object. In the latter case, each checkbox gets a model object mapped to it, probably added when the checkbox is added. Might look something like this:
    Code:
    CheckBoxGroup<Person> group = ...
    group.add(new Person("Colin"), colinCheckbox);
    group.add(new Person("Darrell"), darrellCheckBox);
    etc.

    Of course, now you need to draw those checkboxes somewhere, and you probably get the model objects from somewhere else too - maybe a ListStore? So maybe this should look more like a ComboBox - give it a ListStore<T> full of T objects, and a LabelProvider<T> so generate box labels for the checkboxes, but then how does it actually draw the checkboxes? All in a vertical stack? In a grid, from left to right, the top to bottom, or top to bottom, then left to right? Scrollbars if it gets too big?

    So the short answer is that it is hard to solve this in a definitive, one-size-fits-all manner. My expectation was that lots of people would ask for such a thing, with ideas of what they wanted, and we would flesh it out in a future release, but I think this is the first forum post on the topic. That led me to believe that this isn't a very common problem, or that people build their own solutions readily.

    Thoughts?

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi