datatable Endless server request

By referred Dynamic Loading documents
We modify proxy, It works mostly. but sometimes It loads some data endlessly in a no pager grid.
A grid’s url has only 2 rows data.
But suddenly one empty row added and request ‘start:2’,
in webix_debug.js - _check_rendered_cols. I found this.count() ,suddenly get 2.
I am exhausted in back tracking of functions.(^^;)

Here is the additional information.

Do you have any idea?

Such a situation can occur if you are adding new rows for grid with dynamic loading.

For example, if you have a grid with 12 row, 10 of which are visible. Now, if you call ```g.add({}, 1); it will add a new row into the grid, scrolling to the end of the grid will result in data request for rows 11-13 (!). Originally it was for row 10-12, but because of newly added rows indexes are shifted, and if server side code is not aware of the added row, it will not be able to fulfill the request.

To be safe, do not add or delete rows for the grid with dynamic loading.

loads some data endlessly

If grid needs some row but doesn’t receive them from the server side, it will repeat the data request for the missed rows.

If the problem persists and you have an online demo, please share the demo.

Dear maksim.

Thank you for you comment.

I will be careful when I have to add or delete row.
But The point is that I didn’t add any row intentionally.
In this function, something makes add row and recall ‘load’ again.
webix.ajax.$callback

But I give up to trace the exact place.

I hope you let me know the place. but I know It would be not easy. and you could doubt our code.

More important one is that I want to know if this code is proper.
this is our correction code for webix.proxy.tbdata’s part of load function

if (view.count() > records.total_count) { // in this case, $callback raise reload.
view.data.order.splice(-1, 1); // so I make view.count() same with server’s total count. by cut the last value of data.order.
if (view.count() > records.total_count) {
return; // I don’t know if still view.count() is big. @.@
}
}
webix.ajax.$callback(view, callback, “”, records, -1);

It works for me now. but I don’t know if it is best.
Any opinion?

Thank you again for checking our problem.

The code which you are using is mostly safe, the data order is a single source of truth when the component detects the count of items.

How count can be greater than total_count is not so clear. If you have the online demo where the situation can be reconstructed, we can look in it

Thank you very much for your checking the source.

After observing the situation and if the problem persists, I will ask your advice again.

Thank you again.