So I have utilized custom SQL commands with the .NET connector and tried to implement smart rendering by filtering out the current offset and count via the GET variables and passing it into the custom command as shown in the code below.
The problem is that only gets the first page of results show. It doesn’t continuously update the other rows that are not loaded in the first page.
If I use the Connector by specifying the table, column names and primary key, it does work fine however (e.g. connector = new dhtmlxGridConnector(db_table,columnsToRetrieve,primaryKey,dhtmlxDatabaseAdapterType.Odbc, ConfigurationManager.ConnectionStrings[“ODBC”].ConnectionString + db_schema, extra);).
Is this behaviour not supported by custom SQL commands? If it is not supported, are there any workarounds or better way to do what I wish to do?
int getOffset = 0;
if(!string.IsNullOrEmpty(context.Request.QueryString["posStart"])) Int32.TryParse(context.Request.QueryString["posStart"].ToString(), out getOffset);
int getCount = 0;
if (!string.IsNullOrEmpty(context.Request.QueryString["count"])) Int32.TryParse(context.Request.QueryString["count"].ToString(), out getCount);
if (getCount <= 0) getCount = DYNAMIC_LOAD_COUNT;
sql = "" +
" select distinct main.id, '' as subgrid, main.time, main.subject, main.address, main.transaction_id " +
" from `" + db_table + "` main " +
" where main.type = 'email'" +
" order by main.timestamp desc" +
string.Format(" limit {0},{1}", getOffset, getCount);
primaryKey = "id";
connector = new dhtmlxGridConnector(
sql,
primaryKey,
dhtmlxDatabaseAdapterType.Odbc,
ConfigurationManager.ConnectionStrings["ODBC"].ConnectionString + db_schema,
extra,
false
);
connector.SetDynamicLoading(10);