Hybrid View

  1. #1
    Ext User
    Join Date
    Jul 2010
    Posts
    14
    Vote Rating
    0
    rlebosse is on a distinguished road

      0  

    Default ExtendedRowExpander

    ExtendedRowExpander


    Hello everybody,
    I've used the ExtendedRowExpander class I found on the forum so as to make cascading grids.

    I have only put only grid (sub-grid) under the main one, I have no problems, it works well.
    But if I put another grid (sub-sub-grid) under the one (sub-grid) under the main one, I have some problems.

    There is a "$(body)" that is not supposed to be here. I have to click on the expander to make it disappear and the sub-sub-grid appear.

    I have attached an image to this message that shows my problem.

    And here is the ExtendedRowExpander class code.

    Do you have an idea of how I could make the "$(body)" disappear?

    Thanks for your help,
    Romain

    public class ExtendedRowExpander extends RowExpander
    {
    private Widget contentWidget;
    private LayoutContainer contentContainer;

    public ExtendedRowExpander()
    {
    }

    protected boolean beforeExpand(ModelData model, Element body, El row, int rowIndex)
    {
    RowExpanderEvent e = new RowExpanderEvent(this);
    e.setModel(model);
    e.setRowIndex(rowIndex);
    e.setBodyElement(body);
    e.setRowExpander(this);

    if (fireEvent(Events.BeforeExpand, e))
    {
    if (contentWidget != null)
    {
    body.setInnerHTML(getBodyContent(model, rowIndex));
    // body.setInnerHTML("");
    contentContainer = new LayoutContainer();
    contentContainer.add(contentWidget, new RowData(1, -1));
    contentContainer.render(body);
    contentContainer.layout(true);
    if (!contentContainer.isAttached())
    {
    ComponentHelper.doAttach(contentContainer);
    }
    this.grid.addListener(Events.Detach, new Listener<BaseEvent>()
    {
    public void handleEvent(BaseEvent be)
    {
    if (contentContainer.isAttached())
    {
    ComponentHelper.doDetach(contentContainer);
    }
    }
    });
    }
    return true;
    }
    return false;
    }

    public Widget getContentWidget()
    {
    return contentWidget;
    }

    public void setContentWidget(Widget contentWidget)
    {
    this.contentWidget = contentWidget;
    }
    }
    Attached Images

  2. #2
    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


    Its probably the way how the RowExpander gets the body element.

    Can you please post a single class testcase that implements EntryPoint? You can use inner classes.

  3. #3
    Ext User
    Join Date
    Jul 2010
    Posts
    14
    Vote Rating
    0
    rlebosse is on a distinguished road

      0  

    Default


    I've changed the image size. It was not possible to see anything.
    Attached Images

  4. #4
    Ext User
    Join Date
    Jul 2010
    Posts
    14
    Vote Rating
    0
    rlebosse is on a distinguished road

      0  

    Default


    public class TestGrid extends Composite
    {
    private List<TestData> listStat;
    private ListStore<TestData> statStore = new ListStore<TestData>();
    private ListStore<TestData> statStore2 = new ListStore<TestData>();
    private ListStore<TestData> statStore3 = new ListStore<TestData>();

    private AutoHeightGrid<TestData> gStat;

    @UiConstructor
    public TestGrid()
    {
    this.gStat = makeTestGrid();

    SimplePanel pan = new SimplePanel();
    pan.setWidth("722");
    pan.add(gStat);

    initWidget(pan);
    }

    private AutoHeightGrid<TestData> makeTestGrid()
    {
    List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
    ExtendedRowExpander expander = new ExtendedRowExpander();
    XTemplate tpl = XTemplate.create("");
    expander.setTemplate(tpl);

    List<ColumnConfig> columns2 = new ArrayList<ColumnConfig>();
    ExtendedRowExpander expander2 = new ExtendedRowExpander();
    expander2.setTemplate(tpl);

    List<ColumnConfig> columns3 = new ArrayList<ColumnConfig>();

    /* id column */
    ColumnConfig col3 = new ColumnConfig(TechnicalStat.FIELD_ID, "id", 200);
    col3.setSortable(true);
    col3.setMenuDisabled(true);
    col3.setResizable(true);
    columns3.add(col3);

    AutoHeightGrid<TestData> grid3 = new AutoHeightGrid<TestData>(statStore3, new ColumnModel(
    columns3));
    grid3.setAutoWidth(true);
    grid3.setAutoHeight(true);
    grid3.disableTextSelection(true);
    grid3.setBorders(true);
    grid3.setTrackMouseOver(false);
    grid3.setAutoExpandColumn("id");

    statStore3.add(new TestData("Rom"));
    statStore3.add(new TestData("Rama"));

    expander2.setContentWidget(grid3);
    columns2.add(expander2);

    /* id column */
    ColumnConfig col2 = new ColumnConfig(TechnicalStat.FIELD_ID, "id", 200);
    col2.setSortable(true);
    col2.setMenuDisabled(true);
    col2.setResizable(true);
    columns2.add(col2);

    AutoHeightGrid<TestData> grid2 = new AutoHeightGrid<TestData>(statStore2, new ColumnModel(
    columns2));
    grid2.setAutoWidth(true);
    grid2.setAutoHeight(true);
    grid2.disableTextSelection(true);
    grid2.setBorders(true);
    grid2.setTrackMouseOver(false);
    grid2.setAutoExpandColumn("id");
    grid2.addPlugin(expander2);

    statStore2.add(new TestData("Jean"));
    statStore2.add(new TestData("Jacky"));

    expander.setContentWidget(grid2);
    columns.add(expander);

    /* id column */
    ColumnConfig col = new ColumnConfig(TechnicalStat.FIELD_ID, "id", 200);
    col.setSortable(true);
    col.setMenuDisabled(true);
    col.setResizable(true);
    columns.add(col);

    AutoHeightGrid<TestData> grid = new AutoHeightGrid<TestData>(statStore,
    new ColumnModel(columns));
    grid.setAutoWidth(true);
    grid.setAutoHeight(true);
    grid.disableTextSelection(true);
    grid.setBorders(true);
    grid.setTrackMouseOver(false);
    grid.setAutoExpandColumn("id");
    grid.addPlugin(expander);

    statStore.add(new TestData("Pierre"));
    statStore.add(new TestData("Paul"));
    statStore.add(new TestData("Jacques"));

    return grid;
    }
    }

  5. #5
    Ext User
    Join Date
    Jul 2010
    Posts
    14
    Vote Rating
    0
    rlebosse is on a distinguished road

      0  

    Default


    sven, maybe you know where I can find a better version of what ExtendedRowExpander does?

    Thanks for your help!

  6. #6
    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


    That is not a single class testcase. Without it, its almost impossible to help

  7. #7
    Ext User
    Join Date
    Jul 2010
    Posts
    14
    Vote Rating
    0
    rlebosse is on a distinguished road

      0  

    Default


    I'm sorry sven, it's part of a bigger GWT project, so I don't have a single class testcase (I don't even know how to do it ..).

  8. #8
    Sencha Premium Member
    Join Date
    Dec 2012
    Posts
    4
    Vote Rating
    0
    Trotsky is on a distinguished road

      0  

    Default


    Has anyone found a solution to this? When using a RowExpander with a grid that has disableTextSelection(false), it will not copy the rows that are not displayed, and instead inserts this text into the clipboard: ${body}. I don't really need those expanded rows; but I don't like the ${body} tag being inserted into the copied text.

    Anyone else had to deal with this?

Similar Threads

  1. ExtendedRowExpander
    By Arno.Nyhm in forum Ext GWT: User Extensions and Plugins
    Replies: 16
    Last Post: 28 Jul 2011, 9:13 AM

Thread Participants: 2

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