1C:8.2, Managed Forms.
I need to manually arrange rows in the ValueTable. There is a method named Move(). It receives an index of the current row and the moving direction. I spent a lot of time to find the way to get an index of the current row and this is where I am:
&AtClient Procedure MoveDown(Command) Index = Items.PricesTable.CurrentRow; If Index = Object.PricesTable.Count() - 1 Then Return; EndIf; Object.PricesTable.Move(Index, 1); Items.PricesTable.CurrentRow = Index+1; EndProcedure
I’m doing the following: selecting a row which I would like to move (by clicking on it), clicking on the MoveDown button. The selected row is moving down, but the selection stays where it was. If I remove the last line:
Items.PricesTable.CurrentRow = Index+1;
The selection moves, but the row index does not update. So when I click multiple times only two last rows do change places. How to fix it?