Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    3
    Vote Rating
    0
    Spirann is on a distinguished road

      0  

    Default Grid's cell async render doesn't work

    Grid's cell async render doesn't work


    Some properties for the model I use in my Grid are references.
    I need to fetch asynchronously the real value in the corresponding cell.
    Code:
    ColumnConfig<ArticleModel,String> column = new ColumnConfig<ArticleModel,String>(props.sectionId(), 110, "Section");
    column.setCell(new AbstractCell<String>() {
        @Override
        public void render(Context context, String sectionId, final SafeHtmlBuilder safeHtmlBuilder) {
            asyncService.getSection(sectionId, new AsyncCallback<SectionModel>() {
                @Override
                public void onFailure(Throwable throwable) {}
    
                @Override
                public void onSuccess(SectionModel sectionModel) {
                    safeHtmlBuilder.appendHtmlConstant(sectionModel.getName());
                }
            });
        }
    });
    The value is well fetched but the cell doesn't render it.

    Should I use another way of doing it ? Or is it a bug ?
    Thanks !

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,644
    Vote Rating
    80
    Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice

      0  

    Default


    You almost certainly do not mean to be doing this - you are telling the grid to make an RPC call for every cell to be drawn in this way. Even if you only have a dozen rows to draw, and only use this setup in a single column, that is still 12 calls that will go off at once - and chances are your browser will only allow 2-8 of those to run at a time (depending on the browser, version). Add in something like paging or updating items, and you are looking at a lot of traffic.

    Additionally, SafeHtmlBuilder is like StringBuilder - you can use it to append a bunch of items, then turn the whole collection into a string. The code that created the SafeHtmlBuilder is not waiting until every possible RPC call has finished to create content and append it to the dom.

    Why are these items not loaded into the models themselves? They all still need to be loaded before the grid can be drawn. If you are loading the basic items themselves first, and deferring loading part of each item, you could make that call just before the grid is drawn, update or modify the rows, then draw the grid.

Thread Participants: 1

Tags for this Thread

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