[CLOSED] Rowediting plugin text wrap issue

  1. #1

    [CLOSED] Rowediting plugin text wrap issue

    I am using the main 2.2 release with MVC.

    I have a gridpanel with a rowediting plugin. I do not have a paging toolbar, nor a set height for the gridpanel, so I've already had to address an issue with the Update/Cancel buttons clipping below the bottom of the grid causing scroll bars. But now I'm getting an issue when the text in one of the non-editable cells is longer than the width of the cell. When the row is in edit mode, the text is wrapped - again causing the editing panel to clip/scroll. I'm attaching screenshots of pre-edit and post-edit.

    Firstly - is there something built in already that will cause the grid to "grow" when the rowediting plugin displays?

    Secondly - assuming there is not something in place, is there a way to prevent the text from wrapping when in edit mode?

    Pre-edit
    Click image for larger version. 

Name:	Grid-pre-edit.png 
Views:	17 
Size:	6.5 KB 
ID:	6981

    Post-edit
    Click image for larger version. 

Name:	Grid-post-edit.png 
Views:	16 
Size:	6.9 KB 
ID:	6982
    Last edited by Daniil; Oct 08, 2013 at 6:48 AM. Reason: [CLOSED]
  2. #2
    Hi @jpadgett,

    It looks that both the issues are fixed in the trunk.

    The buttons appear at the top (instead of the bottom) if there is no enough space at the bottom. Scrollbars don't appear. Also the content of non-editable cells doesn't get wrapped.

    Could you test your page with the trunk?
  3. #3
    Hey Daniil,

    Thanks for the reply. I added the trunk build to my project and it does nicely fix the text wrapping issue, and the clipping issue WHEN there are 3 or more rows. However, if there are only 1 or two rows, the Update/Cancel panel clips with no scroll bar. Screenshots:

    1 row editing:
    Click image for larger version. 

Name:	Grid-1-row.png 
Views:	15 
Size:	3.6 KB 
ID:	6985

    2 rows, editing top row:
    Click image for larger version. 

Name:	Grid-2-rows-top-select.png 
Views:	12 
Size:	4.8 KB 
ID:	6986

    2 rows, editing bottom row:
    Click image for larger version. 

Name:	Grid-2-rows-bottom-select.png 
Views:	15 
Size:	4.9 KB 
ID:	6987

    I wrote some code to expand the grid height if there are only 1 or two rows. Don't know if this is best way to approach.

    Html.X().GridPanel()
        ...
        .Plugins(
            Html.X().RowEditing()
                .ClicksToMoveEditor(1)
                .AutoCancel(false)
                .SaveHandler("update")
                .Listeners(l =>
                {
                    l.BeforeEdit.Handler = "raiseGrid(this)";
                    l.CancelEdit.Handler = "lowerGrid(this)";
                    l.Edit.Handler = "lowerGrid(this)";
                })
        )
    
    
    <script type="text/javascript">
    $(function () {
      var grids = Ext.ComponentQuery.query("grid");
      Ext.each(grids, function (grid) {
          grid.prototype.offseth = 0;
          grid.prototype.originalh = 0;
      });
    }
    
    function raiseGrid(plugin) {
        var grid = plugin.getCmp(),
            height = grid.getHeight(),
            store = grid.getStore(),
            recordCount = store.count(),
            record = grid.getSelectionModel().getSelection()[0],
            editIndex = store.indexOf(record),
            indexDiff = recordCount - editIndex;
    
        if (!grid.originalh)
            grid.originalh = grid.getHeight();
    
        if (recordCount < 3) {
            grid.offseth = (indexDiff == 1) ? 35 : 14;
            grid.setHeight(grid.originalh + grid.offseth);
        }
    }
    
    function lowerGrid(plugin) {
        var grid = plugin.getCmp();
        grid.setHeight(grid.originalh);
    }
    </script>
  4. #4
    Yes. But I don't see a generic solution for such cases. I mean where would you show those buttons in such cases?

    I think setting up MinHeight for the GridPanel could be a solution.

Similar Threads

  1. [CLOSED] RowEditing plugin customization
    By bayoglu in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: May 03, 2013, 5:28 PM
  2. RowEditing Plugin Not working
    By GKG4 in forum 2.x Help
    Replies: 2
    Last Post: Apr 27, 2013, 6:49 PM
  3. [CLOSED] About the rowEditing plugin.
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 10, 2012, 11:31 AM
  4. Replies: 10
    Last Post: Jul 31, 2012, 12:25 PM
  5. [CLOSED] RowEditor wrap around text issue
    By gets_gui in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 16, 2012, 4:12 PM

Posting Permissions