[CLOSED] Grid cell editor for long text

  1. #1

    [CLOSED] Grid cell editor for long text

    I have a grid in which a column for user comments may be long (say up to 1024 chars) and will have carriage returns etc. I've got the cell rendering sorted using .Wrap(true) and .Renderer(RendererFormat.Nl2br) properties. The problem comes to editing the cell contents. How do I attach an editor that will also apply the same wrap and Nl2br and that will retain carriage returns ( or <br> markup ) when the comments are committed to store/database. I've exhausted Google/Forums searches and "suck it and see" development.

    Secondly, as the database field size may in future be changed to 4096, I would like to specifiy max width and height to the editor and have it apply scrollbars automatically for long text.
    Last edited by Daniil; Aug 20, 2013 at 9:13 AM. Reason: [CLOSED]
  2. #2
    Hi @ATLAS,

    What field are you using as an Editor? A TextArea?
  3. #3

    TextArea amost solves the issue

    Quote Originally Posted by Daniil View Post
    Hi @ATLAS,

    What field are you using as an Editor? A TextArea?
    Hi Daniil,
    Yes, I'm using a TextArea now. I was't when I posted orginal question :-(.

    That does solve the multiline edit but I hit a few other issues which I've worked around. The first is sizing the editor. It seems to default to a single line height, even when the text in the cell is long. AutoSize on the editor doesn't have an affect (don't know if it should!). I've explicitly set the height on the editor to 50 which is acceptable for me. If I set it more than that, selecting the top cell in the column cause the editor to render it's top bounds outwith that of the grid. It is now usable for editing.

    The last issue is that when double clicking the cell to invoke the editor, selects the row and checks the checkbox of the CheckboxSelectionModel column! Don't want that. I seen to recall seeing similar issue reported by someone else but would welcome your reply.
  4. #4
    Quote Originally Posted by ATLAS View Post
    That does solve the multiline edit but I hit a few other issues which I've worked around. The first is sizing the editor. It seems to default to a single line height, even when the text in the cell is long. AutoSize on the editor doesn't have an affect (don't know if it should!). I've explicitly set the height on the editor to 50 which is acceptable for me. If I set it more than that, selecting the top cell in the column cause the editor to render it's top bounds outwith that of the grid. It is now usable for editing.
    Please try this setup:
    <ext:Column 
        runat="server" 
        Text="Test" 
        DataIndex="test" 
        Wrap="true">
        <Editor>
            <ext:TextArea runat="server" />
        </Editor>
        <EditorOptions>
            <AutoSizeConfig Height="BoundEl" />
        </EditorOptions>
    </ext:Column>
    Quote Originally Posted by ATLAS View Post
    The last issue is that when double clicking the cell to invoke the editor, selects the row and checks the checkbox of the CheckboxSelectionModel column! Don't want that. I seen to recall seeing similar issue reported by someone else but would welcome your reply.
    A row gets selected on single click before editing. I cannot see any appropriate way to distinguish cases when a row should be selected or not, because a selection model doesn't know about editing which, moreover, happens on double click.

    Maybe, something like this:
    <ext:CellEditing runat="server">
        <Listeners>
            <BeforeEdit Handler="e.grid.getSelectionModel().deselect([e.record]);" Delay="100" />
        </Listeners>
    </ext:CellEditing>
    But again, it gets selected on first click, then gets unselected on next click/editing. You can consider setting up ClicksToEdit="1" for the CellEditing.

Similar Threads

  1. [OPEN] [#283] Grid cell editor height
    By jchau in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Jun 21, 2013, 6:11 AM
  2. [CLOSED] Restrict the length of text a user can write into a grid cell...
    By Peter.Treier in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 07, 2013, 2:09 PM
  3. Replies: 1
    Last Post: Sep 24, 2011, 10:52 PM
  4. Replies: 7
    Last Post: Feb 17, 2011, 11:45 AM
  5. Replies: 1
    Last Post: Jul 30, 2009, 6:33 AM

Posting Permissions