Hybrid View

  1. #1
    Ext User
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    961
    Vote Rating
    0
    Arno.Nyhm is on a distinguished road

      0  

    Default ReversedGridSelectionModel

    ReversedGridSelectionModel


    if you like your selection like always the ctrl key is pressed to select rows you can use this selection model:

    PHP Code:
    package org.yournamehere.client.gui.components;

    import com.extjs.gxt.ui.client.Style.SelectionMode;
    import com.extjs.gxt.ui.client.data.ModelData;
    import com.extjs.gxt.ui.client.event.GridEvent;
    import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
    import com.extjs.gxt.ui.client.widget.grid.GridView;
    import java.util.Arrays;

    /**
     *
     * @param <M> the model type contained within the store
     * @author anonym
     */
    public class ReversedGridSelectionModel<extends ModelData> extends GridSelectionModel<M> {

        @
    Override
        
    protected void handleMouseDown(GridEvent<Me) {
            if (
    isLocked()) {
                return;
            }
            if (
    e.isRightClick()) {
                if (
    e.getRowIndex() != -1) {
                    if (
    isSelected(listStore.getAt(e.getRowIndex())) && selectionMode != SelectionMode.SINGLE) {
                        return;
                    }
                    
    select(e.getRowIndex(), false);
                }
            } else {
                
    GridView view grid.getView();
                
    M sel listStore.getAt(e.getRowIndex());

                if (
    selectionMode == SelectionMode.SINGLE) {
                    if (
    isSelected(sel) && e.isControlKey()) {
                        
    deselect(sel);
                    } else if (!
    isSelected(sel)) {
                        
    select(selfalse);
                        
    view.focusCell(e.getRowIndex(), e.getColIndex(), true);
                    }
                } else {
                    if (
    e.isShiftKey() && lastSelected != null) {
                        
    int last listStore.indexOf(lastSelected);
                        
    int index e.getRowIndex();
                        
    int a = (last index) ? index last;
                        
    int b = (last index) ? index last;
                        
    select(abe.isControlKey());
                        
    lastSelected listStore.getAt(last);
                        
    view.focusCell(indexe.getColIndex(), true);
                    } else if (
    isSelected(sel) && !e.isControlKey()) {
                        
    doDeselect(Arrays.asList(sel), false);
                    } else {
                        if (
    isSelected(sel) && e.isControlKey()) {
                            return;
                        }
                        
    doSelect(Arrays.asList(sel), !e.isControlKey(), false);
                        
    view.focusCell(e.getRowIndex(), e.getColIndex(), true);
                    }
                }
            }
        }

    see http://extjs.com/forum/showthread.ph...485#post374485
    This forum needs your help: you got hints from the community and now you have fixed your code? dont just reply with "now its fixed" or "i found the error"! please take the time to post also an detailed answer with the working code.

    GreaseMonkey Script for a GXT-only Forum: it hides ExtJs here: New Posts • Search Results • Advanced Search form • Category overview http://www.extjs.com/forum/showthrea...041#post410041

  2. #2
    Ext User
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    961
    Vote Rating
    0
    Arno.Nyhm is on a distinguished road

      0  

    Default


    something similar for CheckboxSelectionModel

    ExtendedCheckBoxSelectionModel
    http://www.extjs.com/forum/showthread.php?t=81701
    This forum needs your help: you got hints from the community and now you have fixed your code? dont just reply with "now its fixed" or "i found the error"! please take the time to post also an detailed answer with the working code.

    GreaseMonkey Script for a GXT-only Forum: it hides ExtJs here: New Posts • Search Results • Advanced Search form • Category overview http://www.extjs.com/forum/showthrea...041#post410041

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar