Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2350
Default Value no longer works when using the grid dialog edit mode in 16.2
posted

Hello,

Please refer to the following examples: http://jsfiddle.net/k3Lx2v73/4/ is in 15.1 and http://jsfiddle.net/uofcft8z/4/ is in 16.2. Hit the "Add new row" button in 16.2 and an uncaught exception occurs ("Uncaught RangeError: toFixed() digits argument must be between 0 and 20"). This appears to be a result of setting the defaultValue field. I tried a few different methods for setting this (string, decimal, etc), but was unable to get the defaultValue to work properly in 16.2. Please advise.

Thanks,

Paul

Parents
No Data
Reply
  • 17590
    Verified Answer
    Offline posted

    Hello Paul,

    Thank you for posting in our community.

    Valid data mode for numeric editor`s dataMode options is double (what is set in the fiddle provided is decimal). Change this option in the Updating column settings and everything works as expected. For example:

     {
            name: "Updating",
            editMode: "dialog",
            enableAddRow: true,
            columnSettings: [
             {
                   columnKey: "ImageUrl",
                   readOnly: false
            },
            {
                  columnIndex: -1,
                  columnKey: 'InStock',
                  editorType: 'numeric',
                  defaultValue: 0,
                  required: true,
                  editorOptions: {
                  dataMode: 'double',
                  textAlign: 'right',
                  validatorOptions: {
                        required: {
                            errorMessage: 'This field is required.'
                        },
                        onblur: true
                  },
                 minDecimals: 10,
                 maxDecimals: 10,
                 maxValue: 99999999
               },
            validation: true
           }
        ]
     }

    A list with all valid values for dataMode option could be found in our API documentation:

    http://www.igniteui.com/help/api/2016.2/ui.ignumericeditor#options:dataMode

    Your modified fiddle is available at the following link:

    http://jsfiddle.net/uofcft8z/7/

    Please let me know if you need any further assistance with this matter.

Children