Package com.gwtext.client.widgets.grid

Examples of com.gwtext.client.widgets.grid.ColumnModel


        ArrayReader reader = new ArrayReader( recordDef );
        Store store = new Store( proxy,
                                 reader );
        store.load();

        ColumnModel cm = new ColumnModel( new ColumnConfig[]{new ColumnConfig() {
            {
                setHidden( true );
                setDataIndex( "uuid" ); //NON-NLS
            }
        }, new ColumnConfig() {
View Full Code Here


                                 reader );
        store.setDefaultSort( "left",
                              SortDir.DESC );
        store.load();

        ColumnModel cm = new ColumnModel( new ColumnConfig[]{new ColumnConfig() {
            {
                setHidden( true );
                setHeader( "uuid" );
                setSortable( true );
            }
View Full Code Here

    final RecordDef recordDef = new RecordDef(fds);
    ArrayReader reader = new ArrayReader(recordDef);
   
    MemoryProxy proxy = new MemoryProxy(model.getTableAsArray());

    ColumnModel cm = new ColumnModel(cols);
   
    for (int i = 0; i < cm.getColumnCount(); i++) {
      cm.setEditable(i, true);
    }
    store = new GroupingStore(proxy, reader);
    store.load();
    grid = new EditorGridPanel(store, cm);
    grid.setStripeRows(true);
View Full Code Here

        store.setDataProxy(proxy);
    store.setGroupField("isAdmin"); //NON-NLS
    store.setSortInfo(new SortState("userName", SortDir.ASC)); //NON-NLS
    store.load();

    ColumnModel cm  = new ColumnModel(new ColumnConfig[] {
        new ColumnConfig() {
          {
            setDataIndex("userName");                           //NON-NLS
            setSortable(true);
            setHeader(constants.UserName1());
View Full Code Here

    ArrayReader reader = new ArrayReader(recordDef);
    Store store = new Store(proxy, reader);
    store.setDefaultSort("timestamp", SortDir.DESC);
    store.load();

    ColumnModel cm = new ColumnModel(new ColumnConfig[] {
        new ColumnConfig() {
          {
              setDataIndex("severity")//NON-NLS
            setHeader(constants.Severity());
            setSortable(true);
View Full Code Here

     * Call this to set up a table config instead of loading it from the server. You then pass in the config name for later use.
     * Can save a round trip.
     */
    public static void registerTableConf(TableConfig conf, String tableConfig) {
       if (columnConfigs.containsKey(tableConfig)) return;
       ColumnModel cm = createColumnModel( conf );
       columnConfigs.put( tableConfig, cm );
       RecordDef rd = createRecordDef( conf );
       recordDefs.put( tableConfig, rd );
       rowsPerPage.put( tableConfig, new Integer( conf.rowsPerPage ) );
    }
View Full Code Here

                    }
                }
            };
        }

        return new ColumnModel( cfgs );
    }
View Full Code Here

        final RecordDef recordDef = new RecordDef( fds );
        ArrayReader reader = new ArrayReader( recordDef );
        MemoryProxy proxy = new MemoryProxy( dt.data );

        ColumnModel cm = new ColumnModel( cols );
        store = new GroupingStore();
        store.setReader( reader );
        store.setDataProxy( proxy );
        store.setSortInfo( new SortState( "num",
                                          SortDir.ASC ) ); //NON-NLS
        if ( this.dt.groupField != null ) {
            store.setGroupField( dt.groupField );
        }
        cm.addListener(new ColumnModelListenerAdapter(){
           public void onHiddenChange(ColumnModel cm, int colIndex,
             boolean hidden) {
              final String dta = cm.getDataIndex(colIndex);           
               if (colMap.containsKey(dta)) {
                 DTColumnConfig col = colMap.get(dta);
                 col.hideColumn = hidden;
               }
             }   
         });

        store.load();

        final GridPanel grid = new GridPanel( store,
                                              cm );
        grid.setStripeRows( true );

        grid.addGridColumnListener( new GridColumnListener() {
            public void onColumnMove(GridPanel grid,
                                     int oldIndex,
                                     int newIndex) {

                if ( DecisionTableHandler.validateMove( dt,
                                                        oldIndex,
                                                        newIndex ) ) {

                    // Save any changes to the dt.data.
                    scrapeData( -1 );

                    DecisionTableHandler.moveColumn( dt,
                                                     oldIndex,
                                                     newIndex );

                    grid = doGrid();

                } else {
                    // Refresh undoes the move.
                    refreshGrid();
                    ErrorPopup.showMessage( constants.CanNotMoveColumnsFromOneTypeGroupToAnother() );
                }
            }

            public void onColumnResize(GridPanel grid,
                                       int colIndex,
                                       int newSize) {
                // Nothing
            }
        } );

        GroupingView gv = new GroupingView();

        //to stretch it out
        gv.setForceFit( true );
        gv.setGroupTextTpl( "{text} ({[values.rs.length]} {[values.rs.length > 1 ? \"" //NON-NLS
                            + constants.Items() + "\" : \"" + constants.Item() + "\"]})" );

        grid.setView( gv );

        grid.setStore( store );

        int width = 900;
        if ( cm.getColumnCount() > 10 ) {
            width = 900 + (90 * (cm.getColumnCount() - 10));
        }
        grid.setWidth( width );
        grid.setHeight( 500 );

        //Add the cell listener for when the user wants to edit.
View Full Code Here

        valueCol.setEditor(new GridEditor(new TextField()));
        valueCol.setFixed(false);

        ColumnConfig[] columnConfigs = {keyCol, valueCol};

        ColumnModel columnModel = new ColumnModel(columnConfigs);
        columnModel.setDefaultSortable(true);

        final EditorGridPanel grid = new EditorGridPanel();

        Toolbar toolbar = new Toolbar();
        ToolbarButton add = new ToolbarButton(constants.Add(), new ButtonListenerAdapter() {
View Full Code Here

    final RecordDef recordDef = new RecordDef(fds);
    ArrayReader reader = new ArrayReader(recordDef);
   
    MemoryProxy proxy = new MemoryProxy(model.getTableAsArray());

    ColumnModel cm = new ColumnModel(cols);
   
    for (int i = 0; i < cm.getColumnCount(); i++) {
      cm.setEditable(i, true);
    }
    store = new GroupingStore(proxy, reader);
    store.load();
    grid = new EditorGridPanel(store, cm);
    grid.setStripeRows(true);
View Full Code Here

TOP

Related Classes of com.gwtext.client.widgets.grid.ColumnModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.