1. #1
    Ext User
    Join Date
    Feb 2009
    Posts
    11
    Vote Rating
    0
    japochino is on a distinguished road

      0  

    Default A simple grid showing database data!!

    A simple grid showing database data!!


    Hello

    I'm trying to do this but I can't! I don't know why.

    I have a database table containing tadremarks and I want to show them using a grid. I obtain the data from the database by RPC. Perhaps I'm adding de grid to the panel before the RPC method give me the data?

    Some code here:

    public MarcasTabItem() {

    setClosable(true);
    setText(MARCAS_TEXTO);
    setIconStyle("marcas_icono_boton");
    setLayout(new ColumnLayout());

    addListener(Events.Close, new Listener<ComponentEvent>() {
    public void handleEvent(ComponentEvent be) {
    AplicacionPanel.cierraMarcasPanel();
    }
    });

    construyeGrid();



    }

    private void construyeGrid() {

    ConsultaServiceAsync servicioConsulta = (ConsultaServiceAsync) GWT
    .create(ConsultaService.class);

    AsyncCallback<List<Marcas>> callback = new AsyncCallback<List<Marcas>>() {
    public void onFailure(Throwable caught) {
    Info.display("Aviso", "Fallo al consultar las marcas");
    return;
    }

    public void onSuccess(List<Marcas> listaMarcas) {
    setListStore(new ListStore<Marcas>());
    getListStore().add(listaMarcas);

    setGrid(new Grid<Marcas>(listStore, columnModel));
    // getGrid().setContextMenu(menu);
    // getGrid().setLoadMask(true);

    getPanel().setFrame(true);
    getPanel().setAnimCollapse(false);
    getPanel().setButtonAlign(HorizontalAlignment.CENTER);
    getPanel().setIconStyle("marcas_icono_boton");
    getPanel().setHeading("Marcas");
    getPanel().setLayout(new FitLayout());
    getPanel().add(grid);
    getPanel().setSize("100%", "100%");
    // getPanel().setBottomComponent(toolBar);

    add(getPanel());


    return;
    }
    };

    servicioConsulta.marcas("", callback);

    }

    Help please!

    Thank you very much

  2. #2
    Ext GWT Premium Member mariusz.pala's Avatar
    Join Date
    Jun 2008
    Location
    Poland
    Posts
    299
    Vote Rating
    2
    mariusz.pala is on a distinguished road

      0  

  3. #3
    Ext User
    Join Date
    Feb 2009
    Posts
    11
    Vote Rating
    0
    japochino is on a distinguished road

      0  

    Default


    Already done...

    But I donĀ“t understand concepts like:
    • RpcProxy<C,D>
    • BasePagingLoader<PagingLoadConfig, PagingLoadResult>
    • BeanModelReader<C>
    • ListStore<ModelData>
    • BeanModel
    • ColumnModel
    I can figure it out, but I need more information, tutorials, etc. I was very excited about ext gwt, but the little information I could found makes the development very hard.

    I'm depressed!

  4. #4
    Ext User
    Join Date
    Feb 2009
    Posts
    11
    Vote Rating
    0
    japochino is on a distinguished road

      0  

    Default


    Any help please?

Thread Participants: 1