When I provide a very large number to the IGGrid the grid appears to round off the number, and I cannot figure out how to prevent the rounding error. Example:
NPI: 999999999999999999
<table id="enterprise-provider-grid" data-bind="igGrid_nowrap: { dataSource: providerList, primaryKey: 'ProviderId', width: '100%', autoAdjustHeight: true, autoGenerateColumns: false, autoCommit: true, features: [ { name: 'Updating', editMode: 'none', enableAddRow: false, enableDeleteRow: false }, { name: 'Sorting' }, { name: 'Resizing', deferredResizing: true }, { name: 'Paging', pageSize: 10, showPageSizeDropDown: false }, { name: 'Selection', mode: 'row', rowSelectionChanged: setSelectedProviderId } ], columns: [ { headerText: 'ProviderId', key: 'ProviderId', dataType: 'number', hidden: true }, { headerText: 'Name', key: 'Name', dataType: 'string' }, { headerText: 'Tax ID', key: 'TaxId', dataType: 'string' }, { headerText: 'NPI', key: 'Npi', dataType: 'number' }, { headerText: 'Address', key: 'Address1', dataType: 'string' }, { headerText: 'City', key: 'City', dataType: 'string' }, { headerText: 'State', key: 'State', dataType: 'string' }, { headerText: 'Zip Code', key: 'ZipCode', dataType: 'string' }, { headerText: 'Status', key: 'IsActive', dataType: 'bool', formatter: convertStatus } ]}"></table>
Displays:
<td role="gridcell" aria-readonly="false" aria-describedby="enterprise-provider-grid_Npi" tabindex="0" class="ui-iggrid-selectedcell ui-state-active">1000000000000000000</td>
Leave it to QA to find this, and then have the gall to write a defect for it.
Hello Steve,
Please note that by default the max supported decimal places are 15. Therefore if you enter a number containing more than 15 decimal places, then it will be rounded to the nearest possible number. In this case I would suggest you a workaround of this behavior by canceling the valueChanging event of the respective editor and saving the entered value while in edit mode before losing focus in order to set it as new value to the grid. Attached is a sample for your reference.
If you have any questions, please let me know.
Regards,Tsanna
Except in this case I am not updating anything, as a matter of fact, updating is completely disabled. So, your solution does not appear for face value to work.
{ name: 'Updating', editMode: 'none', enableAddRow: false, enableDeleteRow: false }