transport.signalrObject

The configuration used when type is set to "signalr". Configures the SignalR settings - hub, connection promise, server, and client hub methods.

A live demo is available at demos.telerik.com/kendo-ui.

It is recommended to get familiar with the SignalR JavaScript API and ASP.NET Core SignalR.

Example

    <script>
    $.when(
        $.getScript("https://cdnjs.cloudflare.com/ajax/libs/microsoft-signalr/8.0.7/signalr.min.js"),
    ).done(function () {
        var hubUrl = "https://demos.telerik.com/service/v2/signalr/products";
        var hub = new signalR.HubConnectionBuilder()
        .withUrl(hubUrl,{
            skipNegotiation: true,
            transport: signalR.HttpTransportType.WebSockets
        })
        .build();

        var hubStart = hub.start()
            .then(function (e) {
                console.log("SignalR Hub Started!");
            })
            .catch(function (err) {
                return console.error(err.toString());
            });

       
    var dataSource = new kendo.data.DataSource({
    type: "signalr",
    schema: {
      model: {
        id: "ID",
        fields: {
          ID: { editable: false, nullable: true },
          CreatedAt: { type: "date" },
          UnitPrice: { type: "number" },
        },
      },
    },
    transport: {
      signalr: {
        promise: hubStart,
        hub: hub,
        server: {
          read: "read",
          update: "update",
          destroy: "destroy",
          create: "create",
        },
        client: {
          read: "read",
          update: "update",
          destroy: "destroy",
          create: "create",
        },
      },
    },
  });

  dataSource.fetch(function () {
    /* The result can be observed in the DevTools(F12) console of the browser. */
    console.log(dataSource.data());
  });
    });
</script>

transport.signalr.clientObject

Specifies the client-side CRUD methods of the SignalR hub.

transport.signalr.client.createString

Specifies the name of the client-side method of the SignalR hub responsible for creating data items.

transport.signalr.client.destroyString

Specifies the name of the client-side method of the SignalR hub responsible for destroying data items.

transport.signalr.client.readString

Specifies the name of the client-side method of the SignalR hub responsible for reading data items.

transport.signalr.client.updateString

Specifies the name of the client-side method of the SignalR hub responsible for updating data items.

transport.signalr.hubObject

The SignalR hub object returned by the createHubProxy method (or signalR.HubConnection for ASP.NET Core SignalR). The hub option is mandatory.

transport.signalr.promiseObject

The promise returned by the start method of the SignalR connection. The promise option is mandatory.

transport.signalr.serverObject

Specifies the server-side CRUD methods of the SignalR hub.

transport.signalr.server.createString

Specifies the name of the server-side method of the SignalR hub responsible for creating data items.

transport.signalr.server.destroyString

Specifies the name of the server-side method of the SignalR hub responsible for destroying data items.

transport.signalr.server.readString

Specifies the name of the server-side method of the SignalR hub responsible for reading data items.

transport.signalr.server.updateString

Specifies the name of the server-side method of the SignalR hub responsible for updating data items.