Posted 14 September 2017, 12:13 pm EST
Hello
this is the continuation of work that I mentioned in the this thread
now that I have a drop-down in the column I notice that every time the grid loads/reloads/refreshes it triggers event ‘selectedIndexChanged’. As I mentioned I update the one of the column on the same row once the value from the drop-down is selected.
When I update value, I do it in eventHandler of the dropdown. The updated value is not displayed util I call grid.invalidate(). this call triggers the grid refresh and thus infinite loop of events ‘selectedIndexChanged’. another issue when grid refreshed is that the drop-down loosed the selected value
this is code that I have in my event handlder
selectionChanged(methodCb: WjComboBox, event: wjCore.EventArgs) { const currentSelection: myObject = this.flex.selectedItems[0]; if (methodCb) { switch (methodCb.selectedItem.id) { case 'CB': currentSelection.prop1 = currentSelection.Prop1; this.flex.invalidate(); break; case 'WSCPI': alert('yet to be implemented'); methodCb.selectedValue = 'NA'; break; case 'SOFA': currentSelection.prop1 = currentSelection.Prop3 + currentSelection.Prop3; this.flex.invalidate(); break; case 'BR': alert('yet to be implemented'); methodCb.selectedValue = 'NA'; break; case 'TEAC': alert('yet to be implemented'); methodCb.selectedValue = 'NA'; break; case 'TCPI': alert('yet to be implemented'); methodCb.selectedValue = 'NA'; break; case 'MEAC': alert('yet to be implemented'); methodCb.selectedValue = 'NA'; break; default: break; } } }
there are few options that I tried to solve this issue
- I tried to change the value in cell directly using grid.setCellData() . it didn’t display the updated value
- Using dataMap on the column also didn’t work as the dropdown was never displayed. I made the column [isReadOnly]=“false” to make it appear but it didn’t work.
how do I get the updated value displayed and keep the selected value in dropdown selected.
