jQWidgets Forums

jQuery UI Widgets Forums Grid Hide decimal digits and focus after editing start

This topic contains 3 replies, has 2 voices, and was last updated by  desper 10 years, 2 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author

  • desper
    Participant

    Hello,

    I have several questions about JqxGrid and Jqxnumberinput editor>

    1) When I want to edit number in jqxgrid, it shows me zeros after decimal separator. I know, you can rewrite it, but for some older people is it confusing. I would like to do it like in excel. Just write simple number with decimal separator and after saving show the proper cellformat (units, float, dollars etc…)

    Hide zeros

    I start the editor this way:
    editor.jqxNumberInput({ spinButtons: false, spinMode: 'none', inputMode: 'simple' });

    cellsformat is f2, columntype is numberinput

    How should it work:

    How should it work

    2) I have problem with focus in jqxgrid.

    When I want to start edit value in browse, it will select whole text. Like this:
    Selected text in editor

    I need cursor on the end of the text like this:
    Cursor on the end of the word

    I am trying to implement funcionality, that you start edit mode by pressing any letter or number on focused column, but with this focusing is it impossible 🙁

    Thank you for your help, in other cases are jqwidgets perfect!


    Peter Stoev
    Keymaster

    Hi desper,

    1. Use the “numberinput” editor and set its “decimalDigits” property to 0 within the column’s “createeditor” callback.
    2. You will have to implement custom logic for changing the Focusing effect.
    3. “I am trying to implement funcionality, that you start edit mode by pressing any letter or number on focused column” – this is already implemented and demonstrated in All Editing demos.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    desper
    Participant

    Hi Peter:
    1. When I put decimalDigits property to 0 I cannot write numbers with decimal separator etc. 23,54 (can write only 23)
    2. Where can I implement it, is there any .on(“focus”) event handler on jqxnumberinput? I tried in handlekeyboardnavigation, but element is focused later.
    3. If I do, it will start editing only in first column, even focused is other column in selected row.

    3 UPDATE: In selectionmode: singlecell works, in selectionmode: singlerow only in first column


    desper
    Participant

    UPDATE: I edited handleeditkeydown in jqxgrid.edit.js (we paid licence with scripts)

    this part

    for (var m = 0; m < self.columns.records.length; m++) {
                                                var column = self.getcolumnat(m);
                                                if (column.editable) {
                                                    datafield = column.datafield;
                                                    break;
                                                }
                                            }

    caused that edit started always on first column and I changed to
    datafield = arguments[1]._clickedcolumn

    and works it fine, but on decimal numbers when I start edit, it will write first number and second automatically write it after decimal separator.

    for ex I have f2 column and instead of 15,00 I will write (after pressing 1 and 5) 1,50

    This behavior is same without any changes in handlekeydown in singlecell selection mode

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

You must be logged in to reply to this topic.