transport.signalr Object

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.

Example

<script src="https://ajax.aspnetcdn.com/ajax/signalr/jquery.signalr-1.1.3.min.js"></script>
<script>
    var hubUrl = "https://demos.telerik.com/kendo-ui/service/signalr/hubs";
    var connection = $.hubConnection(hubUrl, { useDefaultPath: false});
    var hub = connection.createHubProxy("productHub");
    var hubStart = connection.start({ jsonp: true });

    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"
                }
            }
        }
    });
</script>

Configuration with ASP.NET Core SignalR:

Example

<script src="https://unpkg.com/@aspnet/signalr@1.0.0/dist/browser/signalr.js"></script>
<script>
    var hubUrl = "https://demos.telerik.com/aspnet-core/service/signalr/hubs/products";

    var hub = new signalR.HubConnectionBuilder()
        .withUrl(hubUrl, {
            transport: signalR.HttpTransportType.LongPolling
        })
        .build();

    var hubStart = hub.start()

    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"
                }
            }
        }
    });
</script>

transport.signalr.client Object

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

transport.signalr.client.create String

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

transport.signalr.client.destroy String

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

transport.signalr.client.read String

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

transport.signalr.client.update String

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

transport.signalr.hub Object

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

transport.signalr.promise Object

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

transport.signalr.server Object

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

transport.signalr.server.create String

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

transport.signalr.server.destroy String

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

transport.signalr.server.read String

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

transport.signalr.server.update String

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

In this article