Update/ Refreshing the grid from a database

Hi,

I have an application which displays a grid that relies on complex queries from a DB (dataprocessor can’t handle it, so I have my own JSON methods that work well).

Right now, I have a timer that clears the grid, then queries the database and loads the grid to act as a refresh. However, this cause a distinct flash as it is cleared then reloaded, which is annoying and looks unprofessional.

Is there a way to just update the grid with new entries. I saw the update/refresh from XML methods, but they rely on a saved XML file, which I don’t have. (Since it’s a dynamic database, exporting to XML is not plausible)

Is there any sort of refresh methods (json, csv, or even xml) that will prevent this? The few XML string examples I saw relied on clearing the grid, which presents me with the same problem

Thanks!

how about loading the updated data into a hidden grid and then working through each row to find the changes and apply them to the original grid?

clearly performance will depend on how many rows you have - how often does the refresh timer run?

if the queries are complex then have you considered creating views in the database?

That hidden grid idea is pretty good, but yeah might be pretty demanding. The refresh timer is going every 20 seconds, but going faster would be better. It should never have to pull more than 100-200 entries at a time (if that).

I don’t think views will help us in this case, the update still has to happen in some way and I don’t think dhtmlxgrid supports a view call very well in it’s render_sql

I have used views with render_sql and render_table without any difficulty.

If the view does not have a primary key then the data that is returned will have its own id values.

Your data seems very dynamic with 100-200 new rows in 20 seconds. I am intrigued how you would present such a fast moving grid to the user.