1. #1
    Sencha User
    Join Date
    May 2011
    Posts
    47
    Vote Rating
    0
    nmb1106 is on a distinguished road

      0  

    Default Odd behavior with CheckBoxSelectionModel on Grid

    Odd behavior with CheckBoxSelectionModel on Grid


    I have built a very simple grid with checkbox and name columns. For some reason the checkboxes themselves seem like they are read-only. I have to click the actual row to get the box to populate. This removes the ability to use the header checkbox to select/deselect all.

    Code that builds grid:
    Code:
        public void buildGrid() {
            IdentityValueProvider<SystemModuleDTO> indentity = new IdentityValueProvider<SystemModuleDTO>();
            final CheckBoxSelectionModel<SystemModuleDTO> sm = new CheckBoxSelectionModel<SystemModuleDTO>(
                    indentity);
    
            ColumnConfig<SystemModuleDTO, String> nameColumn = new ColumnConfig<SystemModuleDTO, String>(
                    props.getName(), 200, "Name");
    
            List<ColumnConfig<SystemModuleDTO, ?>> l = new ArrayList<ColumnConfig<SystemModuleDTO, ?>>();
    
            l.add(sm.getColumn());
            l.add(nameColumn);
    
            ColumnModel<SystemModuleDTO> cm = new ColumnModel<SystemModuleDTO>(l);
            ListStore<SystemModuleDTO> store = new ListStore<SystemModuleDTO>(
                    props.key());
    
            grid = new Grid<SystemModuleDTO>(store, cm);
            grid.setSelectionModel(sm);
            grid.getView().setAutoExpandColumn(nameColumn);
            grid.getView().setStripeRows(true);
            grid.getView().setColumnLines(true);
            sm.setSelectionMode(SelectionMode.MULTI);
    
            SystemModuleDTO sample = new SystemModuleDTO();
            sample.setId(1);
            sample.setName("Corporate Video");
            SystemModuleDTO sample2 = new SystemModuleDTO();
            sample2.setId(2);
            sample2.setName("Corporate Video");
            store.add(sample);
            store.add(sample2);
        }
    Video that shows my issue:


  2. #2
    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


    Without a full runnable sample it is hard to say anything for certain, but my immediate guess is that you have duplicate or inconsistent keys in your model objects. Make sure that the props.key() is mapped to a value that is consistent and unique. GXT 3.0.3 or so and beyond enforce this with an assertion to make it harder to make that mistake.

    Beyond that, what version are you using? Can you reproduce this with the http://www.sencha.com/examples/#Exam...e:checkboxgrid sample by changing the code to be more like yours? Can you share a full, runnable test case that lets us reproduce the issue to help you track it down?

  3. #3
    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


    a dead giveaway that you do not have unique keys (if you're using GXT < 3.0.3) is when you click one checkbox, multiple ones become checked.

    i've never tried creating a checkbox grid with a nondeterministic ModelKeyProvider, but imagine the the nondeterministic behavior would carry over into the grid resulting in....um....more nondeterministic behavior.

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..."