jQWidgets Forums

jQuery UI Widgets Forums React jqxNumberInput fails as cell editor

This topic contains 1 reply, has 1 voice, and was last updated by  assembler 7 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • jqxNumberInput fails as cell editor #99038

    assembler
    Participant

    Hello everybody!
    I’m testing the grids and I want to make an inline cells editor, like this:

    {
              text: 'Number',
              datafield: number,
              width: 100,
              align: 'center',
              cellsalign: 'right',
              cellsformat: 'd2',
              columntype: 'numberinput',
              createeditor: (row, cellvalue, editor) => {
                let myvalue = 25;
                editor.jqxNumberInput({
                  'value': myvalue,
                  'allowNull': false,
                  'min': 0,
                  'max': myvalue,
                  'textAlign': 'right',
                  'inputMode': 'simple'
                });
              }
            }

    As you can see this is the definition of a column with a numberinput editor. I want myvalue as the default value in the editor, but it doesn’t take this value, the editor takes the previous value on the cell. How can I do that? Thanks in advance.

    jqxNumberInput fails as cell editor #99052

    assembler
    Participant

    I found a solution myself, I didn’t realize the column has the initeditor property, so I did as follows:

    createeditor: (row, cellvalue, editor) => {
                editor.jqxNumberInput({
                  allowNull: false,
                  min: 0,
                  textAlign: 'right',
                  inputMode: 'simple'
                });
              },
              initeditor: (row, cellvalue, editor, celltext, pressedkey) => {
                editor.jqxNumberInput({value: 25, max: 25});
              }

    And it works, I needed a little bit more research before posting…

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

You must be logged in to reply to this topic.