剑道UI工具栏格模板下拉错误 [英] Kendo UI grid toolbar template Dropdown Error

查看:181
本文介绍了剑道UI工具栏格模板下拉错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<一个href=\"http://stackoverflow.com/questions/15357182/kendo-ui-grid-toolbar-template-dropdown-selector-error-textbox-instead-of-dropd\">Reference1
定2

我遇到的其他一些问题让到这个阶段之前,那些是在Referencea链接详细,反正主要问题是后终于得到下拉(给定2),以显示它,遗憾的是不实际连接到控制器行动应无明显的答案填充它为什么。

I've encountered some other issues prior to getting to this stage and those are detailed in the Referencea link, anyway main problem is after finally getting the dropdown (Reference2) to display it, unfortunately doesn't actually connect to the controller action which should fill it with no obvious answer why.

这似乎表明任何事情,唯一的错误是: -
类型错误:r是未定义
kendo.web.min.js
第13行

The only error which seems to indicate anything is:- TypeError: r is undefined kendo.web.min.js Line 13

在present code我使用的下拉是: -

The present code I'm using for the dropdown is:-

<script type="text/x-kendo-template" id="template">
    <div class="toolbar">
        <label class="category-label" for="external">Show patients by ex:</label>
        <input type="search" id="external" style="width: 230px"></input>
    </div>
</script>

var dropDown = grid.find("#external").kendoDropDownList({
            dataTextField: "ExName",
            dataValueField: "ExId",
            autoBind: false,
            optionLabel: "All",
            dataSource: {
                type: "json",
                severFiltering: true,
                transport: {
                    url: '@Url.Action("_Ex", "Entry")',
                    data: { ignore: Math.random() }
                }
            },
            change: function () {
                var value = this.value();
                if (value) {
                    grid.data("kendoGrid").dataSource.filter({ field: "ExId", operator: "eq", value: parseString(value) });
                } else {
                    grid.data("kendoGrid").dataSource.filter({});
                }
            }
        });



<style scoped="scoped">
    #grid .k-toolbar
    {
        min-height: 27px;
    }
    .external-label
    {
        vertical-align: middle;
        padding-right: .5em;
    }
    #external
    {
        vertical-align: middle;
    }
    .toolbar {
        float: right;
        margin-right: .8em;
    }
</style>

我知道控制器操作的作品,它不是,截至1它甚至没有打来电话,2,因为我用它另一页上,但作为一个层级网格内主电网。

I know the controller action works and it's not that as 1 it's not even called and 2 because I use it on another page but as the main grid within a hierarchy grid.

作为解决此想法或帮助将非常AP preciated。

As ideas or help around this would be much appreciated.

推荐答案

在组合框的数据源的传输配置不正确。为类型的唯一有效值为属性,而你指定'JSON'ODATA。如果要指定数据源运输返回JSON你需要配置数据源是这样的:

The transport configuration of the datasource on the combobox is incorrect. The only valid value for the type property is 'odata' whereas you specify 'json'. If you want to specify that the datasource transport returns json you need to configure your datasource like this:

  dataSource: {
      serverFiltering: true,
      transport: {                    
          read: {
              url: '@Url.Action("_Ex", "Entry")',
              dataType: 'json'
          }
      },
 }

数据类型属性指定什么类型你从服务器的期望了。数据

The dataType property specifies what type of data you're expecting back from the server.

url属性指定的URI远程数据。

The url property specifies the URI for the remote data.

您可以在数据源API 这里找到COM prehensive文档。

You can find comprehensive documentation on the datasource API here.

这篇关于剑道UI工具栏格模板下拉错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆