1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    4
    Vote Rating
    0
    brking is on a distinguished road

      0  

    Default Unanswered: Capturing each checkbox selection change event on Grid

    Unanswered: Capturing each checkbox selection change event on Grid


    I'm new to GSX 3 and trying to figure out how checkbox selection events inn a Grid work in the new model. I just want to get notified on each checkbox check/uncheck change so I can set a boolean property on the model that was clicked. I don't want to get a list of all selected items like the SelectionChangedEvent seems to provide. This was really easy in the 2.x model but I'm not grasping it from the examples. Ther checkbox grid example doesn't seem to handle any events. Thanks for any help.

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

      0  

    Default


    Couldn't you just use the list of models returned by the selection changed event and iterate over them toggling the field in question?

    We use this event to determine the enabled/disabled state of buttons extraneous to the grid that act on the grid (e.g., Delete).

    You are talking about modifying the underlying model object in the grid by hijacking the selection checkbox - something that is probably possible, but arguably not how the CheckboxSelectionModel was designed to be used.

  3. #3
    Sencha User
    Join Date
    Dec 2012
    Posts
    4
    Vote Rating
    0
    brking is on a distinguished road

      0  

    Default


    I don't think that works in multi select mode. How do you know when something is de-selected ? From my testing you basically get a list of all selected items. So I think I would have to do what darrell suggested and keep my own selected list, and compare to the one I get from the event. In 2.x you could bind a checkbox column to a boolean property on the model. It was real easy.

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

      0  

    Default


    The selection event fires every time a checkbox is selected or deselected. I'm not saying that this is the right way to go, but in a selection event handler, you can ask the selection model for a list of the selected items and ensure that any model not in that list receives a false boolean property and true otherwise. Of course, this is an O(n) operation for every checkbox click and certainly not a good solution.

    Why don't you just render a CheckBoxCell for the boolean property on your model and make an editable grid? http://www.sencha.com/examples/#Exam...needitablegrid

    I stand by my previous statement that you are using CheckBoxSelectionModel in a capacity for which it was not really designed.

Thread Participants: 1

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