1. #1
    Ext GWT Premium Member
    Join Date
    Oct 2009
    Posts
    6
    Vote Rating
    0
    nemosoft is on a distinguished road

      0  

    Default Extended grids

    Extended grids


    Hi all,

    We use many grids to show customer's data in our application. And GXT grid control proved to be very useful and handy.

    But there are some cases when the way it's being rendered should be changed.

    Image grid_0.png shows a normal grid:
    ...

    But sometimes it should be shown like on image grid_1.png:
    ...

    Or even like on grid_2.png:
    ...

    In other words cells of one row can be folded into several subrows.

    In order to support this a customized GridView is created. It overrides GridView behavior when
    - column headers are rendered (only columns of first subrow should be shown)
    - grid total width is calculated (some column headers should not be shown)
    - row is rendered into html (more than one tr-elements should be created)
    - Javascript Element object is determined (cause number of tr-elements has been changed, otherwise onClick will work correctly for first subrow only)

    At the moment this approach is implemented as a patch for GXT 2.0.4 (see attached archive).
    Besides CustomGridView it contains slighly patched ColumnHeader class (just a method getColumnCount() is added so that it can be overrided by CustomGridView).

    CustomGridView has two properties:
    - int[] subrowLength (array of subrow lengths)
    - int[][] colSpan (some columns can be extended to 2 and more subrows)

    So for use cases shown above one should type:

    - grid_1.png
    result.setView(new CustomGridView(new int[]{3, 2}, new int[][]{{0,2}}));
    (first subrow consist of 3 columns, the second subrow consists of 2 columns, first column occupies 2 subrows)

    - grid_2.png
    result.setView(new CustomGridView(new int[]{4, 1}, new int[][]{{0,2}, {2,2}, {3,2}}));

    For sure API is not perfect and array things can be changed to whatever else.

    I guess that more people than me and my colleagues need such folded grids.

    So could you please consider if they can be included into next GXT release. TIA
    Attached Images
    Attached Files

  2. #2
    Ext User
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    961
    Vote Rating
    1
    Arno.Nyhm is on a distinguished road

      0  

    Default


    my 2 cents:

    1) the definition is very confusing on the first time ... it should be more easy more easy to define the rowlayout. the verb colspan means in html a different thing.
    2) patching the columnheader is not a good idea. better make the CustomGridview in that way that it can be easy drop in whithout patching existing classes.
    This forum needs your help: you got hints from the community and now you have fixed your code? dont just reply with "now its fixed" or "i found the error"! please take the time to post also an detailed answer with the working code.

    GreaseMonkey Script for a GXT-only Forum: it hides ExtJs here: New Posts • Search Results • Advanced Search form • Category overview http://www.extjs.com/forum/showthrea...041#post410041

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