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?

Tagged:

Comments

  • 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 :-)

  • 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

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!