Repeatedly calling onDataRequest of datatable

Hello Webix Team,
onDataRequest of Datatable contains code of parsing datatble which repeatedly call the same event, there is next line “return false” ,but it won’t work.

snippet:
https://snippet.webix.com/6z2j1ktw

Here is the additional information which i refer :
https://docs.webix.com/api__link__ui.proto_ondatarequest_event.html

how to stop repeat call and parse data on “onDataRequest” event of datatable?

Not webix team, but nevertheless i will post an idea.

it ran´s in your snippet only to a repeat call, if the JSON doesn´t contains data.
Starting at Page4.

If you for testing put the return false statement in first line of the RequestMethod, nothing will happend.
So i think that the parse method don´t like empty fields.

Tipp:
Don´t use alert(); (it´s synchron)
Better use console.log(“Blabla”);
This prevent klicking thousand times, too :slight_smile:

Thanks @ChristianNRW for tipp, but in my case i want to get data onDataRequest call and then parse it for datatable, So on page 4 I want to parse an object which i have added in parse() method which is not empty.

What i am trying to do is i have initially loaded data (for 1st page),I want to get next data on “onDataReuest” in that i have added backend call to getting it then i want to parse it to the grid’s next page

Hello,

Please note that during dynamic loading the widget will constantly request for the data until the initial condition is satisfied.

Have a look at the initial data loaded by the server script from the example:

data:[ /*30 records*/ ], pos:0, total_count:999

If the loading script returns a certain count of records per portion, it will request for the new portion of data starting from the last position and will request for data until the count for records per next portion is loaded.

The count for records per next portion (except for the initial one) is controlled by the datafetch parameter.

So to avoid repeated calls, you need to comply with dynamic loading rules:

  • parse the requested number of records (count parameter of the onDataRequest event);
  • parse them in the required position (start parameter).

Please check the updated snippet: https://snippet.webix.com/rbf01hmv

Thanks @Helga ,It works

hello @Helga,
I realise this is an old thread but i’m hoping the information might assist my similar issue. If the data returned contains data:[ /*358 records*/ ], pos:0, total_count:358 and the datafetch parameter is set to 500, does the library have inbuilt logic to realise no more data is available, or is this something I need to add? Loading a paginated datatable with exactly this situation is producing a constant reload request involving start:0, count:500, continue:true. Depending on other details of the application, the data table in question may have 1 to several hundred thousand rows available from the database. The datafetch parameter is simply a default based on acceptable load times and the average amount of data available from the various options.
Thank you for any guidance you may have
-SrvrSide

@SrvrSide
check your data
repeating id may cause such behavior.

Thank you @intregal - it seems it was this.filterByAll(); within the onAfterLoad event code. It was a throwback to trying to apply existing filters to the newly loaded data. Removing it stopped the incessant loading.
-SrvrSide