1
<input id="btnSearch" type="button" value="search" />
<div id="grid">


<div id="chart"/>

$("#chart").kendoChart({});
var gridResult = $("#grid").kendoGrid({
    dataSource: { data: database },
    columns: [
        {
            field: "id",
            title: "ID"
        },
        {
            field: "x",
            title: "x"
        },
        {
            field: "y"
        },
        {
            field: "z"
        },
        {
            field: "p"
        }
    ]
});

$("#btnSearch").click(function () {
    $filter = new Array();
    $x = $("#txtSearch").val();
    if ($x) {
        $filter.push({ field:"x", operator:"contains", value:$x});
    }
    gridResult.data("kendoGrid").dataSource.filter($filter);
});

现在基于我在文本框中搜索的值,它出现在网格中,我在网格中得到的结果应该更新为图表。我正在努力解决如何在 HTML5 中集成 Kendo 网格和图表。

我是 HTML5 的新手。

因为我需要过滤网格中的值并且基于过滤值图表应该更新。

4

2 回答 2

0

您应该使用共享数据源。请查看此演示

于 2013-01-01T11:17:48.640 回答
0

首先初始化网格,是否可以在文本框中显示搜索到的内容?您在网格中写入更改事件并获取值。在更改功能中,您初始化图表并更新它。

于 2013-01-02T12:41:15.403 回答