referenceResolverFunction

Provides the resolver that the Chat uses when a remote endless batch contains reply references to messages that are outside the current loaded window.

This option is required for off-batch reply previews in remote endless mode. The Chat calls the resolver with a single options object that contains:

  • value - Array<String|Number> - The unique referenced ids that must be resolved.
  • success - Function - Call this function with an array of resolved items.
  • error - Function - Call this function with the resolver error.

The Chat matches resolver results by id, not by returned order. Each resolved item can be a full message object or a partial object, but it must include id, authorId, and enough preview data to render the reply reference such as text, non-empty files, or isDeleted: true. If any requested id is missing from the success result, or if error is called, the incoming remote batch fails.

Example - resolve off-batch reply previews for remote endless scrolling

pseudo
        <div id="chat"></div>
        <script>
            var archiveById = {
                12: {
                    id: 12,
                    authorId: "warehouse-support",
                    authorName: "Warehouse Support",
                    text: "Order 98145 left the regional warehouse at 10:14 AM and is scheduled for next-day delivery.",
                    timestamp: new Date(2026, 0, 5, 10, 14)
                }
            };

            var dataSource = new kendo.data.DataSource({
                transport: {
                    read: {
                        url: "/api/chat/messages",
                        dataType: "json"
                    }
                },
                schema: {
                    data: "data",
                    total: "total"
                },
                serverPaging: true,
                pageSize: 12
            });

            $("#chat").kendoChat({
                authorId: "customer",
                dataSource: dataSource,
                height: 520,
                scrollMode: "endless",
                referenceResolver: function(options) {
                    var resolvedItems = options.value.map(function(id) {
                        return archiveById[id];
                    }).filter(Boolean);

                    options.success(resolvedItems);
                }
            });
        </script>
In this article
referenceResolver
Not finding the help you need?
Contact Support