Paging overlap

I noticed that when the datasource asks for the second page it also asks for the last record from the first page.
This results in a mismatch in the number of records returned and the setTotalRows value.

The first page is from 0-75 and the second page is from 75-150, record 75 is fetched and shown twice in my grid. Shouldn’t this be 0-74 and 75-149 ?

The following error comes up because of this
16:31:08.445 [ERROR] [esos] 18:31:08.450:WARN:ResultSet:isc_ResultSet_0 (created by: isc_OID_3):fetchData callback: dsResponse.endRow set to:81. dsResponse.totalRows set to:80. endRow cannot exceed total dataset size. Clamping endRow to the end of the dataset (80).

The indices are inclusive at the beginning and exclusive at the end (like String.substring())

Ok, that makes sort of sense :slight_smile:
So when using Ms Sql ROW_NUMBER();
smartgwt page 1 ask for row 0-75 and is expecting DB row 1-75
smartgwt page 2 ask for row 75-150 and is expecting DB row 76-150

The paging query for SqlServer with the startRow and endRow provided by smartGWT is

SELECT * FROM (
  select  top {endRow}ROW_NUMBER() OVER(Order by [columnName] DESC) as Row, *
   from [tableName]) as page
WHERE  Row>{startRow}