0

I am having an editor grid with four columns and i am trying to implement a sql builder. The where statement will have four fields namely "condition1" "operator" "condition2" "and/or". I am using a combo box to select between and/or/none and there is a delete button as row action. when I delete a row and if that row is the last,the value of and/or combo in the previous row will be set as "none". I am able to achieve that but the problem is , when the combo box is selected in the previous row and i delete the row next to it, the value changes in the store but not in the view. the value changes in the view when the combo box is not selected in the previous row. my code is :

if(rowIndex == grid.all.endIndex)
   {
    //get the previous record and set the vale to none
    var previousRowRecord = grid.store.getAt(rowIndex-1); 
    previousRowRecord.set('andor','NONE');
    //delete the current record
    grid.getStore().removeAt(rowIndex);
    grid.getView().refresh();
   }
else
   {
     grid.getStore().removeAt(rowIndex);
   }

How to deselect a combo box once the value is selected ? i think this can be a work around

Tarabass
  • 3,132
  • 2
  • 17
  • 35
user2380811
  • 55
  • 1
  • 7

1 Answers1

0

Not sure if I understood you correctly (a screenshot would help out a lot here), but it may sound like the combo box is still in the edit state when you are deleting the row below. If so, try the following:

First make sure the grid editor plugin has an id:

plugins: [{
    ptype: 'cellediting',
    ...
    pluginId: 'celleditplugin'
}],

Then, before deleting the row, do the following:

yourGrid.getPlugin('celleditplugin').completeEdit();
Dag Sondre Hansen
  • 2,449
  • 20
  • 22