Hi,
I'm using SmartGWT Pro and I have a ListGrid with a DataSource that's connected to a MySQL Database. The datasource is defined through a XML-file and looks like this:
I'm using a Timer on the client-side to refresh the content every second, but I'm only interested in the last 20 rows. Is it possible to tell the fetch operation to only fetch the last 20 rows? In SQL I would have written something like
I know that I can use
but I don't know number of rows.
I'm using SmartGWT Pro and I have a ListGrid with a DataSource that's connected to a MySQL Database. The datasource is defined through a XML-file and looks like this:
Code:
<DataSource ID="messageSummary" serverType="sql" tableName="message_summary">
<fields>
<field name="id" title="ID" type="sequence" primaryKey="true" hidden="true" canExport="false" export="false"/>
<field name="sequence_number" title="Number" type="integer" width="100" align="center"/>
<field name="date" title="Date" type="text" width="100" align="center"/>
<field name="time" title="Time" type="text" width="100" align="center"/>
<field name="type" title="Type" type="text" align="left"/>
</fields>
</DataSource>Code:
select * from tbl_name order by id desc limit 20;Code:
n = (no. of rows)
DSRequest.setStartRow(n-20)
DSRequest.setEndRow(n)