Thanks, i've tested the latest nightly of 2 Dec and it seems that the case in the gif is now properly handeld.
But it seems there is some parts missing an update. In the example the second selectbox will always change to the same value as selected in the first selectbox. So if you change the first selectbox the second have to change (this works). after this you can change the second selectbox and the sum at the end is correctly calculated. But if you change the first selectbox again after this, the second selectbox is not properly changed.
See here:
Here is the example, which can be used to reproduce this behaviour:
Regards Simon
But it seems there is some parts missing an update. In the example the second selectbox will always change to the same value as selected in the first selectbox. So if you change the first selectbox the second have to change (this works). after this you can change the second selectbox and the sum at the end is correctly calculated. But if you change the first selectbox again after this, the second selectbox is not properly changed.
See here:
Here is the example, which can be used to reproduce this behaviour:
Code:
function changedSelectOneField(p3){ theRealEditedRow = theListGrid.getEditRow(); var i = theRealEditedRow; var theEditedRowIndex = i; var index = theEditedRowIndex var record = theListGrid.data[theEditedRowIndex]; console.log(index); var updatedData = {}; if(theRealEditedRow == i){ record.checkBox1Field = true; record.checkBox2Field = false; record.selectOneField = p3; record.backSelect1Field=2; record.dayDateColumn="NOW ITS CHANGED"; record.backSelect2Field=3; record.priceField= "-4,80 €"; record.backSelect3Field=3; record.selectTwoField = p3; var sum = (record.backSelect1Field + record.backSelect2Field + record.backSelect3Field + record.selectTwoField + record.selectOneField); record.priceField = sum+",00 €"; record.sumField = (parseInt(p3)+parseInt(p3)+ sum)+",00 €"; theListGrid.data.dataChanged(); } } function changedSelectTwoField(p3){ theRealEditedRow = theListGrid.getEditRow(); var i = theRealEditedRow; var theEditedRowIndex = i; var index = theEditedRowIndex var record = theListGrid.data[theEditedRowIndex]; console.log(index); var updatedData = {}; if(theRealEditedRow == i){ record.selectTwoField = p3; var sum = (record.backSelect1Field + record.backSelect2Field + record.backSelect3Field + record.selectTwoField + record.selectOneField); record.priceField = sum+",00 €"; record.sumField = (parseInt(p3)+parseInt(p3)+ sum)+",00 €"; theListGrid.data.dataChanged(); } } function change1(){ } function change2(){ } function change3(){ } isc.ListGrid.create( { autodraw: true, "ID":"theListGrid", "width":"100%", "height":"100%", "hideUsingDisplayNone":false, "leaveScrollbarGap":true, "selectionType":"single", "canEdit":true, "canEditCell":function (rowNumber, columNumber) { if (rowNumber == 0 && (columNumber == 2 || columNumber == 8)) return false; return this.Super('canEditCell', arguments); }, "editEvent":"click", "autoSaveEdits":false, "alternateRecordStyles":true, "modalEditing":true, "timeFormatter":"toShort24HourTime", "sortField":"nil", "sortDirection":"ascending", "fixedRecordHeights":false, "neverValidate":true, "selectionProperty":"isSelected", "showRecordComponents":true, "showRecordComponentsByCell":true, "canGroupBy":false, "canPickFields":false, "clwGeneratedIndexName":"daysListGridGeneratedIndex", "fields": [ { "name":"dayDateColumn", "title":"Date", "type":"text", "align":"right", "width":200, "canEdit":false }, { "name":"selectOneField", "title":"Select one", "canEdit":true, "canSort":false, "editorType":"SelectItem", "showValueIconOnly":false, "suppressValueIcon":true, "editorProperties": { "ID":"selectOneField_Editor", "changed":function (p1, p2, p3) {changedSelectOneField(p3)}, "suppressValueIcon":true, "prompt":"", "textMatchStyle":"substring" }, "valueMap": { 1:"Burger", 2:"Pommes", 3:"Pizza", 4:"Cola", 5:"Beer", 6:"Water", 7:"Ham", 8:"Chicken", 9:"Beacon", 10:"Peach", 11:"Banana" } }, { "name":"selectTwoField", "title":"Select two", "formatCellValue":function (value, record, rowNum, colNum ) { if( rowNum == 0 ){return null}else{return value;}}, "canEdit":true, "canSort":false, "editorType":"SelectItem", "emptyCellValue":"n\/a", "showValueIconOnly":false, "suppressValueIcon":true, "editorProperties": { "ID":"selectTwoField_Editor", "changed":function (p1, p2, p3) {changedSelectTwoField(p3)}, "suppressValueIcon":true, "textMatchStyle":"substring" }, "valueMap": { 1:"Burger", 2:"Pommes", 3:"Pizza", 4:"Cola", 5:"Beer", 6:"Water", 7:"Ham", 8:"Chicken", 9:"Beacon", 10:"Peach", 11:"Banana", 12:"n\/a" } }, { "changed":function (p1, p2, p3) {}, "name":"backSelect1Field", "title":"BackSelect 1", "width":80, "canEdit":true, "canSort":false, "editorType":"SelectItem", "editorProperties": { "changed":function (p1, p2, p3) {change1()}, "prompt":"", "textMatchStyle":"substring", "ID":"backSelect1Field_Editor" }, "valueMap": { 1:"Yes", 2:"Maybe", 3:"No" } }, { "changed":function (p1, p2, p3) {}, "name":"backSelect2Field", "title":"BackSelect 2", "width":78, "canEdit":true, "canSort":false, "editorType":"SelectItem", "editorProperties": { "changed":function (p1, p2, p3) {change2()} }, "valueMap": { 1:"Yes", 2:"Maybe", 3:"No" } }, { "changed":function (p1, p2, p3) {}, "name":"backSelect3Field", "title":"BackSelect 3", "width":78, "canEdit":true, "canSort":false, "editorType":"SelectItem", "editorProperties": { "changed":function (p1, p2, p3) {change3()}, "textMatchStyle":"substring", "ID":"backSelect3Field_Editor" }, "valueMap": { 1:"Yes", 2:"Maybe", 3:"No" } }, { "name":"priceField", "title":"Price", "type":"text", "align":"right", "width":55, "canEdit":false, "canSort":false }, { "changed":function (p1, p2, p3) {}, "name":"checkBox1Field", "title":"Tag", "type":"boolean", "width":45, "canEdit":true, "canSort":false, "canToggle":false, "editorProperties": { "ID":"checkBox1Field_Editor" } }, { "changed":function (p1, p2, p3) {}, "name":"checkBox2Field", "title":"Nacht", "type":"boolean", "width":45, "canEdit":true, "canSort":false, "canToggle":false, "editorProperties": { "ID":"checkBox2Field_Editor" } }, { "name":"sumField", "title":"Sum Prize", "type":"text", "align":"right", "width":62, "canEdit":false, "canSort":false } ], "members": [], "data": [ { "checkBox1Field":true, "checkBox2Field":false, "selectOneField":2, "sumField":"12,00 €", "backSelect1Field":1, "dayDateColumn":"Mi, 22.10.2014", "backSelect2Field":3, "priceField":"-4,80 €", "backSelect3Field":3, "selectTwoField":12 }, { "checkBox1Field":true, "checkBox2Field":true, "selectOneField":6, "sumField":"122,00 €", "backSelect1Field":1, "dayDateColumn":"CHANGE THIS and PRESS ENTER --->", "backSelect2Field":1, "priceField":"-41,00 €", "backSelect3Field":1, "selectTwoField":6 } ] } );
Comment