jQWidgets Forums

jQuery UI Widgets Forums Editors NumberInput Set caret position on init

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 12 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Set caret position on init #18851

    Karl
    Participant

    I’m using a numberinput in conjunction with jqxgrid as column editor.
    My problem is that when you begin editing a cell the cursor position is initialised to the very end of input field. This means that if you then try and type some numbers nothings happens, the user has to click in the cell to initialise the editor then move the cursor to the start or another position in the cell first.
    Is it possible to override this functionality? Ideally it’d be good to initialise the editor with everything in the input field selected after the symbol character so the user can simply type the value and it will override that in there.

    I tried to create this functionality using a jquery-textrange plugin.

    initeditor: function (row, cellvalue, editor) {
    editor.find(‘input[type=text]’).textrange(‘set’);
    }

    this correctly selected the text as desired but immediately after this initialise method the jqxnumberinput code reset the cursor position to the end of the input field.

    Set caret position on init #18854

    Peter Stoev
    Keymaster

    HI Karl,

    Unfortunately, it is not possible to change the cursor’s position through API.

    Best Regards,
    Peter Stoev

    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.