Results 1 to 8 of 8

Thread: Ext.grid.EditorGridPanel Merge cells on different rows

  1. #1

    Default Ext.grid.EditorGridPanel Merge cells on different rows

    Hello,

    I'd like to know if it is possible to merge a cell spanning on (let's say) 4 consecutive rows and show a read-only content in that cell. I'm thinking I can edit the renderer of that column and decide when I need to do this - the problem is - I don't know how to merge (or at least hide) the other cells.

    What would be the best approach to achieving this? If it's not technically possible, what other GUI alternatives would you recommend to allow users to see information associated to some data (maybe a panel with a property grid?)?

    The table I want to render should look something like this (pardon the ascii art):
    Code:
    ----------|------------|
    row 1     |            |
    ----------|  merged    |
    row 2     |            |
    ----------|     row    |
    row 3     |            |
    ----------|------------|

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    There are two possible solutions:
    1. Fake row spanning (see here).
    2. Use a different GridView (e.g. TableGridView) that could actually supports row spanning (TableGridView doesn't support this by default - you will need to rewrite the cell rendering for this).

  3. #3

    Default

    Thank you Condor, I will try your first example.

  4. #4

    Default

    Just for the record, the first solution worked beautifully when the cells had the same value. The only problem (cosmetic) is that if the row has a background color, you can still see the unmerged cells - but it's no biggie.

    On question though - What happens when I try to edit the cell? I see I get only one editor. I guess I would be editing just one value. I know I first asked for a readonly cell merge, but I am curious...

  5. #5

    Default

    Correction - I can edit the cells, but the trick is you have to click the cell near the end of the input field in order to display that value, otherwise it enables just the first row's editor

  6. #6
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    So you can still click on the cells that are covered by the first cell? That shouldn't be possible! Maybe the css isn't completely correct?

    ps. If you would want to make it editable then you should only be able to edit the first cell and in the afteredit event you would have to set the new value to the other records that had the same old value.

  7. #7

    Default

    Yes, I can barely click near the rightmost edge of the cell and I get an editor. It's not an issue, and your suggestion for editing the first record and propagating the change is very good, thanks

  8. #8
    Sencha User
    Join Date
    Jun 2012
    Posts
    4

    Default Two colums merge

    Hi condor,
    i implemented ur logic of fake row spanning , worked like charm

    but now there is requirement that two columns should have row spanning .

    i tried out with the same logic in rendere of another column but was unsuccessful .. Can u plz help me out

    attaching my screen shot



    Quote Originally Posted by Condor View Post
    There are two possible solutions:
    1. Fake row spanning (see here).
    2. Use a different GridView (e.g. TableGridView) that could actually supports row spanning (TableGridView doesn't support this by default - you will need to rewrite the cell rendering for this).
    Attached Images Attached Images

Similar Threads

  1. How can i merge two rows in some columns of a row using grid panel.
    By nagasesha in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 29 Jul 2008, 10:56 PM
  2. Disappearing Cells/Rows in IE in Ext.grid.GridEditor
    By RickB in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 7 Jan 2008, 2:27 PM
  3. How to merge and split cells?
    By yangyz in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 3 Jun 2007, 3:39 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •