Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we configure Kendo grid data source to be Synchronous

Can we configure Kendo grid data source to be Synchronous

  .DataSource(dataSource =>
           dataSource.Ajax()

  .Model(model =>
    {
  .Read(read => read.Action("Products_Read", "Home")))
  .......


  $("#grid").data("kendoGrid").dataSource.read();

Is this is an Ajax Asynchronous call. If so can we make this call to a Synchronous call. Please suggest me a solution. Thank you.

like image 750
Jagath Jayasinghe Avatar asked Dec 11 '22 12:12

Jagath Jayasinghe


1 Answers

To force the Kendo datasource for synchronous behavior, configure your datasource transport with async: false e.g.

    var datasource = new kendo.data.DataSource({
        type: "odata",
        transport: {
            read: {
                async: false,
                url: function (data) {
                    return "/odata/Product";
                },
                dataType: "json"
            },
        },
    });
like image 145
LeLong37 Avatar answered Jan 17 '23 12:01

LeLong37