r1 and r2 are records, but what is positionNumberColumnName? If that is what it sounds (a number indicating some column index), then this won’t work. It should be the name of a dataprovider.
and positionNumberColumnName is a parameter of the function recalculatePositionNumbers which contains the above code. positionNumberColumnName contains ‘posnr’.
patrick:
If that is what it sounds (a number indicating some column index), then this won’t work. It should be the name of a dataprovider.
It sounds like the column name for the position number.
that the size before sorting is > 0 and then after sort it is 0 ?
Yes.
before sort: 2
after sort: 0
but only if in the frameworks ‘add’ mode. If in ‘edit’ mode fs.sort( sortFunction ) leaves the foundset intact as long as I don’t create a new record. For example, if I have 3 saved records in the database, go to edit, create a new record, then delete a database saved record and then sort the froundset, then form shows only the 2 database saved records. The new created record is also lost after sort. As a workaround I use:
It seems that this problem occurs, if it’s a FoxPro DBF table and the “row_ident” in Servoy is declared as “db identity” and in FoxPro the column is declared as “Integer (Autoinc)”. I changed the “row_ident” in Servoy to “servoy seq” and the column in FoxPro DBF to “Integer” and now the foundset is not empty after sort.