Hi there,
I found a bug using the latest nightly of Smartclient 10.1 (SmartClient_v101p_2015-12-17_Pro)
We have a ListGrid and everytime you change the value of an selectItem a second one will also be changed to the value of the first one.
For this example I simplified our listgrid and added a change-counter at the end of the ListGrid.
With Smartclient 10.0 you can see every change in Country 1 has the effect, that the Counter is increasing and the SelectItem in Country 2 is also updated properly.
With Smartclient 10.1 this doesn't work anymore. If you begin the editing mode, only the first change will result in a change of Country 2 and the Counter-column.
The right behaviour is certainly the behaviour of Smartclient 10.0, because in 10.1 the fields are not updated properly.
I have had a similar problem one year ago (about the 12 december, sadly I cannot link to the old post, since it seems to be deleted) upgrading from Smartclient 9.1 to 10.0. One year ago there was also a bug in ListGrid.data.dataChanged(); maybe you could add a testcase for this behaviour. It's quite frustrating to report similar errors upgrading from one to another and also at the next version-upgrade.
Here is the code for reproduction:
Best Regards
I found a bug using the latest nightly of Smartclient 10.1 (SmartClient_v101p_2015-12-17_Pro)
We have a ListGrid and everytime you change the value of an selectItem a second one will also be changed to the value of the first one.
For this example I simplified our listgrid and added a change-counter at the end of the ListGrid.
With Smartclient 10.0 you can see every change in Country 1 has the effect, that the Counter is increasing and the SelectItem in Country 2 is also updated properly.
With Smartclient 10.1 this doesn't work anymore. If you begin the editing mode, only the first change will result in a change of Country 2 and the Counter-column.
The right behaviour is certainly the behaviour of Smartclient 10.0, because in 10.1 the fields are not updated properly.
I have had a similar problem one year ago (about the 12 december, sadly I cannot link to the old post, since it seems to be deleted) upgrading from Smartclient 9.1 to 10.0. One year ago there was also a bug in ListGrid.data.dataChanged(); maybe you could add a testcase for this behaviour. It's quite frustrating to report similar errors upgrading from one to another and also at the next version-upgrade.
Here is the code for reproduction:
Code:
var globalChangeCount = 0; isc.ListGrid.create({ "ID" : "theListGrid", "width" : "100%", "height" : "100%", "hideUsingDisplayNone" : false, "leaveScrollbarGap" : true, "selectionType" : "single", "canEdit" : true, "editEvent" : "click", "autoSaveEdits" : false, "alternateRecordStyles" : true, "modalEditing" : true, "canReorderFields" : false, "timeFormatter" : "toShort24HourTime", "autoFitWidthApproach" : "both", "fixedRecordHeights" : false, "neverValidate" : true, "selectionProperty" : "isSelected", "canPickFields" : false, "clwGeneratedIndexName" : "generatedRecordIndex", "fields" : [{ "name" : "dayDateColumn", "title" : "Date", "type" : "text", "align" : "right", }, { "name" : "country1Field", "title" : "Country 1", "canEdit" : true, "canSort" : false, "editorType" : "SelectItem", "imageURLPrefix" : "\/HRworks\/images\/flags\/", "imageURLSuffix" : ".png", "suppressValueIcon" : false, "showValueIconOnly" : false, "showHover" : true, "valueIcons" : { 1 : "ET", 2 : "GUE", 3 : "ETH", 4 : "AFG", 5 : "AL", 6 : "DZ", 7 : "AND", 8 : "AN", 9 : "ATG", 10 : "AR", 11 : "ARM", 12 : "AZ", 13 : "AUS" }, "editorProperties" : { "ID" : "country1Field_45Editor", "changed" : function (p1, p2, p3) { console.log([p1, p2, p3]); globalChangeCount = globalChangeCount + 1; var record = theListGrid.data.find("generatedRecordIndex", 2); record.sumGridField_measure = "€"; record.sumGridField = globalChangeCount; record.deductionGridField = 0; record.deductionGridField_measure = "€"; record.country2Field = p3; theListGrid.data.dataChanged(); theListGrid.markForRedraw(); theListGrid.saveAllEdits(); }, "suppressValueIcon" : false, "textMatchStyle" : "substring" }, "valueMap" : { 1 : "Ägypten", 2 : "Äquatorialguinea", 3 : "Äthiopien", 4 : "Afghanistan", 5 : "Albanien", 6 : "Algerien", 7 : "Andorra", 8 : "Angola", 9 : "Antigua und Barbuda", 10 : "Argentinien", 11 : "Armenien", 12 : "Aserbaidschan", 13 : "Australien" } }, { "name" : "country2Field", "title" : "Country 2", "canEdit" : true, "canSort" : false, "editorType" : "SelectItem", "imageURLPrefix" : "\/HRworks\/images\/flags\/", "imageURLSuffix" : ".png", "emptyCellValue" : "n\/a", "suppressValueIcon" : false, "showValueIconOnly" : false, "showHover" : true, "valueIcons" : { 1 : "ET", 2 : "GUE", 3 : "ETH", 4 : "AFG", 5 : "AL", 6 : "DZ", 7 : "AND", 8 : "AN", 9 : "ATG", 10 : "AR", 11 : "ARM", 12 : "AZ", 13 : "AUS" }, "editorProperties" : { "ID" : "country2Field_45Editor", "changed" : function (p1, p2, p3) { if (p3 == parseInt(p3)) { var grid = p2.grid; grid.getRecord(grid.getEditRow()).selected_country2Field = p3 }; globalChangeCount = globalChangeCount + 1; var record = theListGrid.data.find("generatedRecordIndex", 2); record.sumGridField_measure = "€"; record.sumGridField = globalChangeCount; record.deductionGridField = 0; record.deductionGridField_measure = "€"; record.country1Field = p3; theListGrid.data.dataChanged(); theListGrid.markForRedraw(); theListGrid.saveAllEdits(); }, "suppressValueIcon" : false, "textMatchStyle" : "substring" }, "valueMap" : { 1 : "Ägypten", 2 : "Äquatorialguinea", 3 : "Äthiopien", 4 : "Afghanistan", 5 : "Albanien", 6 : "Algerien", 7 : "Andorra", 8 : "Angola", 9 : "Antigua und Barbuda", 10 : "Argentinien", 11 : "Armenien", 12 : "Aserbaidschan", 13 : "Australien", 14 : "n\/a" } }, { "name" : "sumGridField", "title" : "Counter", "align" : "right", "width" : 62, } ], "data" : [{ "sumGridField_measure" : "€", "generatedRecordIndex" : "2", "country1Field" : 1, "country2Field" : 1, "sumGridField" : 0, "dayDateColumn" : "17.12.15", } ] }); isc.Button.create({ left:100, top:100, "action": function(){ var theFinalString = ""; for(var i =0; i< theListGrid.data.length; i++){ var currentData = theListGrid.data[i].country2Field; theFinalString += currentData+", "; console.log(currentData); } isc.say("This is in: "+theFinalString); }, "title": 'values currently in select two', width: 200, }); isc.Button.create({ left:100, top:120, "action": function(){ isc.say("There were "+globalChangeCount+" changes"); }, "title": 'how many changes?', width: 200, });
Comment