Incorrect ordenation of the new sort indicator column when used in TWebDBTableControl

WEB Core version:

There is an issue when use SortIndicator on TWebDBTableControl that turn it unusable.

It is very easy to reproduce it:

  1. load any dataset from a XData server.
  2. Insert a SortIndicator at any columns number X, row 0.

WebDBTableControl1.AddSortIndicator( X {column},0 {row},TGridSortIndicator.siAscending);

  1. Then click on icon to sort the X-esima column.
  2. The dataset will be sorted using the column X-1, not the column X. To the user (like me after a lot of hours), it seems that the sort is wrong and the X-esima column was not sorted in correct way, what is correct.

Other problem, based in same case, I think that it is due a wrong index base: 0 or 1,

when click on SortIndicator at cells [0,0], to sort the first column, occurs this error:

WEBLib.Grids.pas:8165 Uncaught TypeError: Cannot read properties of undefined (reading 'innerText')
at getCellValue (WEBLib.Grids.pas:8165:1)
at WEBLib.Grids.pas:8168:1
at Array.sort ()
at Object.Sort (WEBLib.Grids.pas:8173:1)
at Object.DoSortClick (WEBLib.Grids.pas:6538:3)
at Object.HandleDoClick (WEBLib.Grids.pas:6905:5)
at HTMLDivElement.cb (rtl.js:236:1)

The problem does not occur with the TWebTableControl component, only the TWebDBTableControl.

Thanks for reporting.
We traced & solved this issue. The next update will address this.