ParamQuery grid support forum
General Category => Suggest new features => Topic started by: devspec on November 24, 2017, 07:07:03 pm
-
As you suggested me here (https://paramquery.com/forum/index.php?topic=2418.0), I reload data and refresh the whole grid:
setInterval(function () { ReloadList() }, 5000);
function ReloadList() {
$.getJSON("/api/Parse/TasksList?type=0&page=&api_key=", function (data) {
$grid.pqGrid('option', 'dataModel.data', data.data);
$grid.pqGrid('refreshView');
});
}
But every 5 seconds selected cell is blinking - I recorded the video, you can see this behaviour here (https://www.youtube.com/watch?v=lkkIs2TVJec) on youtube.
And if a cell selected on top of a table and I scrolled a page down, every 5 seconds page scrolls by her own to selected cell position. I also recorded it and you can see it here (https://www.youtube.com/watch?v=L_DRP-aSBkM).
So, the questions are:
1. How to avoid blinking of selected cell during grid refresh?
2. How to avoid upscroll of page to selected cell during grid refresh?
Thank you
-
Oh, I found another one important problem: every 5 seconds (when I refresh grid) all checked checboxes becames unchecked.
Video is here (https://www.youtube.com/watch?v=PALwQw15c8Q)
-
In your previous post you mentioned the requirement to refresh remote data in grid every 5 seconds, which is normally done for read only data. So I proposed solution based on refreshView()
In this post, you want the user to make changes in the grid at the same time which implies there are 2 simultaneous independent data sources for the same grid. Naturally one data source is going to overwrite the changes from other data source.
Can you please elaborate what you are trying to do.
-
Ok, I elaborate SAAS-service with behaviour like:
1. User adds to queue new long-running task with progress reporting. It looks like: http://joxi.ru/BA0pZydSJjDBbA
2. The service in background do this task and reports progress to user. Every 5 second data from server reloads and change appears in right places - in columns with progress, summ etc.
3. User can check checkbox near this task or other tasks and delete it or export it's results during any task execution
Now it works with Knockout table, but it's not very comfortable for me as a developer to work with it.
So, the main question is: how to refresh pqgrid according to only changed data?
As an example:
- if user add one task - only first row appears and the last row goes to second page (if pagination).
- if data in JSON from server was changed only in "progress" field - only a "progress" cell of according row need to be changed.
I think, it's very useful option - it's redundantly to refresh all the table if only one cell really needs to be refreshed.
-
I've put together a demo for selective refresh of cells based on refreshCell method.
https://paramquery.com/pro/demos/refreshCell
You would need to compare the remote data with data in grid to find out the changed cells.
-
Yes, I thought about that.
But it's very hard work - to consider all the possible moments like - adding one task, adding several tasks, deleting task, deleting several tasks etc.
Maybe you, as owner of the grid, can develop a method like refreshPartially or refreshChanges that will refresh only changed data in grid in view of pagination and so on?
I think, it will be very useful method for everyone.
-
Ok, I'm moving it to feature request board, would check and analyze how it can be simplified.
-
Hi! Is this implemented in any way?