jQuery UI Widgets Forums Grid How to wrap textbox while editing…

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 9 years, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • How to wrap textbox while editing… #75282

    markm123
    Participant

    Here’s the problem I’m having:

    When the grid is displayed: the cell content is automatically wrapped but when I click on the textbox to edit it all appears on one line …

    http://www.turboimagehost.com/p/23949268/problem.png.html

    Anyway to fix?

    How to wrap textbox while editing… #75291

    Dimitar
    Participant

    Hello markm123,

    You can try using a custom textarea cell editor. Here is how to configure such an editor for one column:

    columns: [{
                text: 'First Name',
                columntype: 'template',
                datafield: 'firstname',
                width: 80,
                createeditor: function(row, cellvalue, editor, cellText, width, height) {
                    var textareaElement = $('<textarea></textarea>').prependTo(editor);
                    textareaElement.css({
                        width: width,
                        height: height
                    });
                },
                initeditor: function(row, cellvalue, editor, celltext, pressedkey) {
                    var textarea = editor.find('textarea');
                    textarea.val(cellvalue);
                },
                geteditorvalue: function(row, cellvalue, editor) {
                    return editor.find('textarea').val();
                }
            },
            ...

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.