没有在data source.read函数中获取更新的值

时间:2013-12-27 08:45:28

标签: javascript kendo-ui kendo-grid kendo-asp.net-mvc

我的问题是我在更改事件的filterA函数中设置了值,但是当我在this.datasource.read()函数中调用filterB时,我没有获得更新的值。到目前为止我的代码:

function FilterA(element) {
    element.kendoDropDownList({
        dataSource: {
            transport: {
                read: '@Url.Action("Filter_A")'
            }
        },
        change: function (e) {
            var index = 1;
            var temp = "";
            $(".k-input").each(function () {
                if (index === 3) {
                    temp = $(this).text();

                }
                index++;
            });
            index = 1;

            $('#hdntemp').val(temp);
        },
        optionLabel: "--Select Value--"
    });

}

function FilterB(element) {
    element.kendoDropDownList({
        dataSource: {
            transport: {
                read: '@Url.Action("Filter_B")' + "?temp=" + $('#hdntemp').val()
            }
        },
        open: function (e) {
            this.dataSource.read();
        },
        optionLabel: "--Select Value--"
  });
}

1 个答案:

答案 0 :(得分:0)

我找到了解决方案 在oncreate函数中全局保存数据源元素,并在onchange函数中调用函数以获得级联效果。

相关问题