1. #1
    Sencha User
    Join Date
    Sep 2009
    Posts
    289
    Vote Rating
    0
    diegolovison is on a distinguished road

      0  

    Default grid + selection; before render..

    grid + selection; before render..


    if needed select one item in a grid before render.. I try the code below... but dont have success...
    its correct?

    p.s.: if you click in the first line in the grid, will see that the item cannot more selected..

    xp
    hosted mode
    gxt 2.0.1
    gwt 1.7.0

    Code:
            final List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
    
            ColumnConfig column = new ColumnConfig();
            column.setId("name");
            column.setHeader("Company");
            column.setWidth(200);
            configs.add(column);
    
            column = new ColumnConfig();
            column.setId("symbol");
            column.setHeader("Symbol");
            column.setWidth(100);
            configs.add(column);
    
            column = new ColumnConfig();
            column.setId("last");
            column.setHeader("Last");
            column.setAlignment(HorizontalAlignment.RIGHT);
            column.setWidth(75);
            configs.add(column);
    
            column = new ColumnConfig("change", "Change", 100);
            column.setAlignment(HorizontalAlignment.RIGHT);
            configs.add(column);
    
            column = new ColumnConfig("date", "Last Updated", 100);
            column.setAlignment(HorizontalAlignment.RIGHT);
            column.setDateTimeFormat(DateTimeFormat.getShortDateFormat());
            configs.add(column);
    
            final ListStore<Stock> store = new ListStore<Stock>();
            store.add(TestData.getStocks());
    
            final ColumnModel cm = new ColumnModel(configs);
    
            final ContentPanel cp = new ContentPanel();
            cp.setBodyBorder(false);
            cp.setHeading("Basic Grid");
            cp.setButtonAlign(HorizontalAlignment.CENTER);
            cp.setLayout(new FitLayout());
            cp.setSize(600, 300);
    
            final Grid<Stock> grid = new Grid<Stock>(store, cm);
            grid.setStyleAttribute("borderTop", "none");
            grid.setAutoExpandColumn("name");
            grid.setBorders(true);
            grid.setStripeRows(true);
            grid.getSelectionModel().select(0, true);
            cp.add(grid);
    
            RootPanel.get().add(cp);

  2. #2
    Sencha User
    Join Date
    Sep 2009
    Posts
    289
    Vote Rating
    0
    diegolovison is on a distinguished road

      0  

    Default


    in the method processRows in the GridView, should be verify if the row was selected.. its one ideia..

  3. #3
    Sencha User
    Join Date
    Sep 2009
    Posts
    289
    Vote Rating
    0
    diegolovison is on a distinguished road

      0  

    Default


    this work fine

    Code:
        @Override
        public void onModuleLoad() {
    
            final List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
    
            ColumnConfig column = new ColumnConfig();
            column.setId("name");
            column.setHeader("Company");
            column.setWidth(200);
            configs.add(column);
    
            column = new ColumnConfig();
            column.setId("symbol");
            column.setHeader("Symbol");
            column.setWidth(100);
            configs.add(column);
    
            column = new ColumnConfig();
            column.setId("last");
            column.setHeader("Last");
            column.setAlignment(HorizontalAlignment.RIGHT);
            column.setWidth(75);
            configs.add(column);
    
            column = new ColumnConfig("change", "Change", 100);
            column.setAlignment(HorizontalAlignment.RIGHT);
            configs.add(column);
    
            column = new ColumnConfig("date", "Last Updated", 100);
            column.setAlignment(HorizontalAlignment.RIGHT);
            column.setDateTimeFormat(DateTimeFormat.getShortDateFormat());
            configs.add(column);
    
            final ListStore<Stock> store = new ListStore<Stock>();
            store.add(TestData.getStocks());
    
            final ColumnModel cm = new ColumnModel(configs);
    
            final EventType BeforeProcessRows = new EventType();
    
            final GridView view = new GridView() {
                @Override
                protected void processRows(final int startRow, final boolean skipStripe) {
                    super.processRows(startRow, skipStripe);
                    grid.fireEvent(BeforeProcessRows);
                }
            };
    
            final Grid<Stock> grid = new Grid<Stock>(store, cm);
            grid.setStyleAttribute("borderTop", "none");
            grid.setAutoExpandColumn("name");
            grid.setBorders(true);
            grid.setStripeRows(true);
            grid.setView(view);
            grid.addListener(BeforeProcessRows, new Listener<BaseEvent>() {
                @Override
                public void handleEvent(final BaseEvent be) {
                    grid.getSelectionModel().select(0, true);
                }
            });
    
            final ContentPanel cp = new ContentPanel();
            cp.setBodyBorder(false);
            cp.setHeading("Basic Grid");
            cp.setButtonAlign(HorizontalAlignment.CENTER);
            cp.setLayout(new FitLayout());
            cp.setSize(600, 300);
            cp.add(grid);
    
            RootPanel.get().add(cp);
        }

  4. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    This feature was already added to 2.0.2

  5. #5
    Sencha User
    Join Date
    Sep 2009
    Posts
    289
    Vote Rating
    0
    diegolovison is on a distinguished road

      0  

    Default



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