smartBox.suggestionTemplateFunction
Represents the template for a suggestion in the SmartBox component AI Assistant mode.
Example - set a custom suggestion template
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "ProductName" },
{ field: "UnitPrice" }
],
dataSource: {
data: [
{ ProductName: "Tea", UnitPrice: 10 },
{ ProductName: "Coffee", UnitPrice: 15 }
]
},
search: {
fields: [{ name: "ProductName", operator: "contains" }]
},
toolbar: ["smartBox"],
smartBox: {
suggestionTemplate: (dataItem) => `<span class="suggestion-item">${dataItem.suggestion}</span>`,
aiAssistantSettings: {
enabled: true,
promptSuggestions: ["Show top products", "Calculate average price"]
}
}
});
</script>