jQuery UI Widgets Forums Form type of a number in a form

This topic contains 6 replies, has 2 voices, and was last updated by  Martin 1 year, 6 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • type of a number in a form #104265

    Paul45
    Participant

    Hello

    Is it possible to have an input which is an Integer and not a float with NumberInput?

    Like on this example :
    https://stackblitz.com/github/jqwidgets/angular_demos/tree/master/form/input_types/

    is it possible to replace float by an integer ?

    Thanks!

    type of a number in a form #104266

    Paul45
    Participant

    IS it only possible with getComponentByName and not a the creation of form?
    Because it’s more simple at the creation… Because I know if it’s a float or integer only at the initialization…

    • This reply was modified 1 year, 6 months ago by  Paul45.
    type of a number in a form #104269

    Paul45
    Participant

    I have found a solution… But after iitialization..

    In my template type is integer.
    And initialized, I loop on my form where type == integer And after I get the component by the name :

    var inputValue = form.getComponentByName('puissance')
    inputValue.jqxNumberInput({decimalDigits:0, groupSeparator: " ",promptChar:""}) 

    But now, my function OnDataChange for the form doesn’t work… Why ?

    Thanks a lot

    • This reply was modified 1 year, 6 months ago by  Paul45.
    type of a number in a form #104271

    Paul45
    Participant

    I have Edit my stackblitz to show you :

    https://stackblitz.com/edit/github-wzadlj

    When i modify my Input Number it doesn’t work…

    Sorry for 4 messages but I can’t edit…

    Do you understand what I want?
    Just a form with an inputNumber which is an integer ..
    It’s very complexe to make that I don’t understand why

    type of a number in a form #104296

    Martin
    Participant

    Hello Paul,

    You need to set the type of the field in FormTemplateItem to ‘number’ and not ‘integer’.
    I have updated your Example.

    Your approach for modifying the field by getComponentByName is correct.

    Best Regards,
    Martin

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

    type of a number in a form #104302

    Paul45
    Participant

    Ok, it works but.. I need to tell at my input what kind of it is (Integer or Float)…
    And for that, i need to give a value at my template which can tell me what kind of it is..

    Because sometimes it’s a float, and other time an int.. Only a value in my template can tell me when I need to apply my approach for modifying the field or not

    I need a field on my template like that :

          {
            bind: 'nubmberBoxValue',
            name: 'nubmberBoxValue',
            type: 'number',
            infoType:'integer',
            label: 'Number input',
            labelPosition: 'left',
            labelWidth: '30%',
            align: 'left',
            width: '250px',
            required: true
          },

    And after I can check if infoType is an integer or a float.. If it’s a float I can realize your approach

    Do you understand my case?…

    • This reply was modified 1 year, 6 months ago by  Paul45.
    type of a number in a form #104307

    Martin
    Participant

    Hello Paul45,

    You can create another array which will keep which number type fields are integers and which float
    and check there if you need to modify the input.

    Please, look at the following Example.

    Best Regards,
    Martin

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

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

You must be logged in to reply to this topic.