Hi,
I have a ListGrid with a customer editor component for one of the cells (2nd cell). When the value of that cell is decimal, clicking on the edit icon or double-clicking on the cell to initiate edit results in JavaScript errors.
In fact, values like this: 150 or even 150.0 work just fine. But when the original value from the data source is 150.1 or 150.11, etc, editing fails with the JavaScript error.
This definitely used to work with SmartClient 11.1 Pro version. The problem started happening only when I upgraded to 13.0 Pro.
SmartClient_v130p_2023-08-12_Pro
Reproduced on Chrome and FF.
Adding parseFloat(), changing column or editor type to "number" or "float" doesn't help.
It fails even when changed() method is empty and change() method is removed.
Here is the code.
Error on Chrome:
ISC_Core.js:2641 Uncaught TypeError: _1.toFixed is not a function
at _3.isc_SpinnerItem__defaultGetNextValue [as $118d] (ISC_Forms.js:3330:57)
at _3.isc_SpinnerItem_getNextValue [as getNextValue] (ISC_Forms.js:3328:88)
at _3.isc_SpinnerItem_setValue [as setValue] (ISC_Forms.js:3343:48)
at _3.isc_DynamicForm_setItemValues [as setItemValues] (ISC_Forms.js:616:333)
at _3.isc_DynamicForm_setValues [as setValues] (ISC_Forms.js:493:38)
at _3.isc_ListGrid_makeEditForm [as makeEditForm] (ISC_Grids.js:2266:160)
at _3.isc_ListGrid_showInlineEditor [as showInlineEditor] (ISC_Grids.js:2202:22)
at _3.isc_ListGrid__startEditing [as $31u] (ISC_Grids.js:2189:6)
at _3.isc_ListGrid_startEditing [as startEditing] (ISC_Grids.js:2166:110)
at _3.eval [as click] (eval at isc__makeFunction (ISC_Core.js:91:1135), <anonymous>:3:16)
at _3.isc_StatefulCanvas_handleActivate [as handleActivate] (ISC_Foundation.js:241:108)
at _3.isc_StatefulCanvas_handleClick [as handleClick] (ISC_Foundation.js:242:13)
at _3.isc_c_EventHandler_bubbleEvent [as bubbleEvent] (ISC_Core.js:2542:89)
at _3.isc_c_EventHandler_handleClick [as handleClick] (ISC_Core.js:2350:50)
at _3.isc_c_EventHandler__handleMouseUp [as $k5] (ISC_Core.js:2332:11)
at _3.isc_c_EventHandler_handleMouseUp [as handleMouseUp] (ISC_Core.js:2323:57)
at _3.isc_c_EventHandler_dispatch [as dispatch] (ISC_Core.js:2641:122)
at HTMLDocument.eval (eval at isc__makeFunction (ISC_Core.js:91:1135), <anonymous>:3:123)
Error on FF:
Uncaught TypeError: _1.toFixed is not a function
isc_SpinnerItem__defaultGetNextValue https://localhost:8443/astro/isomorp..._Forms.js:3330
isc_SpinnerItem_getNextValue https://localhost:8443/astro/isomorp..._Forms.js:3328
isc_SpinnerItem_setValue https://localhost:8443/astro/isomorp..._Forms.js:3343
isc_DynamicForm_setItemValues https://localhost:8443/astro/isomorp...C_Forms.js:616
isc_DynamicForm_setValues https://localhost:8443/astro/isomorp...C_Forms.js:493
isc_ListGrid_makeEditForm https://localhost:8443/astro/isomorp..._Grids.js:2266
isc_ListGrid_showInlineEditor https://localhost:8443/astro/isomorp..._Grids.js:2202
isc_ListGrid__startEditing https://localhost:8443/astro/isomorp..._Grids.js:2189
isc_ListGrid_startEditing https://localhost:8443/astro/isomorp..._Grids.js:2166
anonymous https://localhost:8443/astro/isomorp...es/ISC_Core.js line 91 > Function:3
isc_StatefulCanvas_handleActivate https://localhost:8443/astro/isomorp...ndation.js:241
isc_StatefulCanvas_handleClick https://localhost:8443/astro/isomorp...ndation.js:242
isc_c_EventHandler_bubbleEvent https://localhost:8443/astro/isomorp...C_Core.js:2542
isc_c_EventHandler_handleClick https://localhost:8443/astro/isomorp...C_Core.js:2350
isc_c_EventHandler__handleMouseUp https://localhost:8443/astro/isomorp...C_Core.js:2332
isc_c_EventHandler_handleMouseUp https://localhost:8443/astro/isomorp...C_Core.js:2323
isc_c_EventHandler_dispatch https://localhost:8443/astro/isomorp...C_Core.js:2641
anonymous https://localhost:8443/astro/isomorp...es/ISC_Core.js line 91 > Function:3
isc_c_EventHandler_captureEvent https://localhost:8443/astro/isomorp...C_Core.js:2644
isc_c_EventHandler_captureEvents https://localhost:8443/astro/isomorp...C_Core.js:2649
<anonymous> https://localhost:8443/astro/isomorp...C_Core.js:2790
Thank you.
gene
I have a ListGrid with a customer editor component for one of the cells (2nd cell). When the value of that cell is decimal, clicking on the edit icon or double-clicking on the cell to initiate edit results in JavaScript errors.
In fact, values like this: 150 or even 150.0 work just fine. But when the original value from the data source is 150.1 or 150.11, etc, editing fails with the JavaScript error.
This definitely used to work with SmartClient 11.1 Pro version. The problem started happening only when I upgraded to 13.0 Pro.
SmartClient_v130p_2023-08-12_Pro
Reproduced on Chrome and FF.
Adding parseFloat(), changing column or editor type to "number" or "float" doesn't help.
It fails even when changed() method is empty and change() method is removed.
Here is the code.
Code:
isc.ListGrid.create({ ID:"epSumDB", width:360, height:274, showEmptyMessage:false, canEdit:true, editByCell:true, selectionType:"single", showRollOverCanvas:true, showRollUnderCanvas:false, rollOverCanvasConstructor:isc.HLayout, rollOverCanvasProperties:{ snapTo:"C", height:20, width:55, members:[ { _constructor:"Button", icon:"pencil_editing.png", click: "epSumDB.startEditing(epSumDB.getRowNum(this.parentElement.record), 2)", height:20, width:27 } ] }, fields: [ {name:"id", showIf:"false"}, {name:"lng", title:"Original Value", canSort: false, width:68, canEdit:false}, {name:"lngE", title:"Change Value", type:"number", width:64, showHover:true, hoverHTML:"return 'Change value'"}, {name:"sum", title:"Sum", width: 66, canEdit:false}, {name:"rval", title: "R", width: 18, align: "center", formatCellValue: "(value<0?'R':'')", canEdit:false} ] ,hoverWidth:100 ,getEditorProperties:function(editField, editedRecord, rowNum){ console.log("getEditorProperties() editField.name="+editField.name+"; rowNum="+rowNum); if(editField.name=="lngE"){ var item = { editorType:"SpinnerItem", minValue:0.0, maxValue:360.0, step:1.0, //type:"float", change:function(form,item,value){ epSumDB.setEditValue(rowNum,1.0,value); }, changed:function(form,item,value){ epSumDB.setEditValue(rowNum,1.0,parseFloat(value)); console.log("getEditorProperties.changed() value="+value); var cRec = epSumDB.getEditedRecord(rowNum); if(cRec.id<13) refreshPane(2, cRec.id, cRec.lngE); } }; return item; } return null; } ,cellContextClick: "console.log('irrelevant')" });
Error on Chrome:
ISC_Core.js:2641 Uncaught TypeError: _1.toFixed is not a function
at _3.isc_SpinnerItem__defaultGetNextValue [as $118d] (ISC_Forms.js:3330:57)
at _3.isc_SpinnerItem_getNextValue [as getNextValue] (ISC_Forms.js:3328:88)
at _3.isc_SpinnerItem_setValue [as setValue] (ISC_Forms.js:3343:48)
at _3.isc_DynamicForm_setItemValues [as setItemValues] (ISC_Forms.js:616:333)
at _3.isc_DynamicForm_setValues [as setValues] (ISC_Forms.js:493:38)
at _3.isc_ListGrid_makeEditForm [as makeEditForm] (ISC_Grids.js:2266:160)
at _3.isc_ListGrid_showInlineEditor [as showInlineEditor] (ISC_Grids.js:2202:22)
at _3.isc_ListGrid__startEditing [as $31u] (ISC_Grids.js:2189:6)
at _3.isc_ListGrid_startEditing [as startEditing] (ISC_Grids.js:2166:110)
at _3.eval [as click] (eval at isc__makeFunction (ISC_Core.js:91:1135), <anonymous>:3:16)
at _3.isc_StatefulCanvas_handleActivate [as handleActivate] (ISC_Foundation.js:241:108)
at _3.isc_StatefulCanvas_handleClick [as handleClick] (ISC_Foundation.js:242:13)
at _3.isc_c_EventHandler_bubbleEvent [as bubbleEvent] (ISC_Core.js:2542:89)
at _3.isc_c_EventHandler_handleClick [as handleClick] (ISC_Core.js:2350:50)
at _3.isc_c_EventHandler__handleMouseUp [as $k5] (ISC_Core.js:2332:11)
at _3.isc_c_EventHandler_handleMouseUp [as handleMouseUp] (ISC_Core.js:2323:57)
at _3.isc_c_EventHandler_dispatch [as dispatch] (ISC_Core.js:2641:122)
at HTMLDocument.eval (eval at isc__makeFunction (ISC_Core.js:91:1135), <anonymous>:3:123)
Error on FF:
Uncaught TypeError: _1.toFixed is not a function
isc_SpinnerItem__defaultGetNextValue https://localhost:8443/astro/isomorp..._Forms.js:3330
isc_SpinnerItem_getNextValue https://localhost:8443/astro/isomorp..._Forms.js:3328
isc_SpinnerItem_setValue https://localhost:8443/astro/isomorp..._Forms.js:3343
isc_DynamicForm_setItemValues https://localhost:8443/astro/isomorp...C_Forms.js:616
isc_DynamicForm_setValues https://localhost:8443/astro/isomorp...C_Forms.js:493
isc_ListGrid_makeEditForm https://localhost:8443/astro/isomorp..._Grids.js:2266
isc_ListGrid_showInlineEditor https://localhost:8443/astro/isomorp..._Grids.js:2202
isc_ListGrid__startEditing https://localhost:8443/astro/isomorp..._Grids.js:2189
isc_ListGrid_startEditing https://localhost:8443/astro/isomorp..._Grids.js:2166
anonymous https://localhost:8443/astro/isomorp...es/ISC_Core.js line 91 > Function:3
isc_StatefulCanvas_handleActivate https://localhost:8443/astro/isomorp...ndation.js:241
isc_StatefulCanvas_handleClick https://localhost:8443/astro/isomorp...ndation.js:242
isc_c_EventHandler_bubbleEvent https://localhost:8443/astro/isomorp...C_Core.js:2542
isc_c_EventHandler_handleClick https://localhost:8443/astro/isomorp...C_Core.js:2350
isc_c_EventHandler__handleMouseUp https://localhost:8443/astro/isomorp...C_Core.js:2332
isc_c_EventHandler_handleMouseUp https://localhost:8443/astro/isomorp...C_Core.js:2323
isc_c_EventHandler_dispatch https://localhost:8443/astro/isomorp...C_Core.js:2641
anonymous https://localhost:8443/astro/isomorp...es/ISC_Core.js line 91 > Function:3
isc_c_EventHandler_captureEvent https://localhost:8443/astro/isomorp...C_Core.js:2644
isc_c_EventHandler_captureEvents https://localhost:8443/astro/isomorp...C_Core.js:2649
<anonymous> https://localhost:8443/astro/isomorp...C_Core.js:2790
Thank you.
gene
Comment