Recalculating all index numbers following deleting a row
I built a form having rows, where there is item numbers for each row such as 1 / 2 / 3 ...
I use following to add a new instance:
form1.Button.Button1::click - (FormCalc, client)
Table1._Row1.addInstance();
I use following to delete the last instance:
form1.Button.Button2::click - (FormCalc, client)
var nCount = Table1.Row1.instanceManager.count ;
//remove instance
Table1.Row1.instanceManager.removeInstance(nCount-1);
Below script is to show row numbers at the first column.
form1.Table1.Row1.ItemNo::enter - (FormCalc, client)
var rowCount = this.parent.instanceManager.count;
form1.Table1.Row1.ItemNo::calculate - (FormCalc, client)
this.rawValue = this.parent.index + 1;
these above works great; however lately I needed to delete a random instance which is not the last row using:
form1.Table1.Row1.#subform[0].del_button::click - (JavaScript, client)
_Row1.removeInstance(this.parent.parent.index);
Now there is such a bug when I delete another instance which is not the last instance, row numbers do not recalculate.
so lets say: I have row numbers 1 / 2 / 3 / 4 and delete the 3rd instance; row numbers listed appears 1 / 2 / 4
Is there a way each time an instance is deleted below script to work: