标签: kendo-combobox

Kendo UI组合框重置值

我在级联模式下使用Kendo UI ComboBoxes来构建我想要应用的过滤器.

如何清除/重置Kendo UI ComboBox的值?

我试过了:

$("#comboBox").data("kendoComboBox").val('');
$("#comboBox").data("kendoComboBox").select('');
$("#comboBox").data("kendoComboBox").select(null);
Run Code Online (Sandbox Code Playgroud)

一切都无济于事.该项目是使用Razor引擎的MVC4应用程序,代码与Kendo UI示例基本相同.

asp.net-mvc-4 kendo-ui kendo-combobox

13
推荐指数
1
解决办法
2万
查看次数

我如何从kendo comboBox中获取选择值

我已经实现了剑道ComboBox,但努力获得选定的价值....

  $("#_FeeScheme_Input").kendoComboBox({
        minLength: 1,
        filter: 'contains',
        dataTextField: "FeeSchemeDescription",
        dataValueField: "FeeSchemeID",
        select: onSelect,
        dataSource: {
            type: "json",
            serverFiltering: false,
            transport: {
                read: "/Qualification/GetAllFeeScheme_JSON"
            },
        }
    });
Run Code Online (Sandbox Code Playgroud)

...

 function onSelect(e) {

        var dataItem = this.dataItem(e.item.index());

        alert("value " + dataItem.text); //NOT WORKING... RETURN NULL VALUE            

    };
Run Code Online (Sandbox Code Playgroud)

剃刀代码

 <div class="form-group">
                @Html.LabelFor(model => model._FeeScheme.FeeSchemeDescription, new { @class = "control-label col-md-3" })
                <div class="col-md-6">
                    @Html.TextBoxFor(model => model._FeeScheme.FeeSchemeDescription, new { id = "_FeeScheme_Input" })
                    @Html.ValidationMessageFor(model => model._FeeScheme.FeeSchemeDescription)
                </div>
 </div>
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc kendo-ui kendo-combobox

6
推荐指数
2
解决办法
3万
查看次数

Kendo ComboBox 值模板?

使用 Kendo ComboBox,我为来自 Web 服务的一些数据创建了一个选择器。HTML 代码如下所示:

<kendo-combobox #myPicker 
    [data]="myData" 
    [valueField]="'ID'"
    [textField]="'Number'" 
    [filterable]="true"
    [allowCustom]="false"
    (valueChange)="onChange($event)">
    <ng-template kendoComboBoxItemTemplate let-dataItem>
        {{dataItem.Number}} - {{dataItem.Subject}}
    </ng-template>
</kendo-combobox>
Run Code Online (Sandbox Code Playgroud)

项目模板工作完美,它完全按照需要显示。我现在想做的是格式化所选值(文本字段本身中显示的值)。现在,它只选择 中提供的字段[textField],在本例中为Number

有什么方法可以格式化选定的值吗?我查了文档,好像没有这个模板。我还尝试使用该[value]属性并在那里设置自定义字符串,但这会破坏组合框,因为它需要一个对象。

combobox kendo-combobox kendo-ui-angular2 angular

6
推荐指数
0
解决办法
2357
查看次数

Kendo-Combobox的SelectionChange和ValueChange事件之间的区别

我刚刚开始在Angular中研究Kendo Controls。我在这里找到了一个示例其中它同时使用了selectionChange和valueChange事件。那么,我的问题是这两者以及何时使用它们有什么区别?

谢谢

kendo-ui kendo-combobox

6
推荐指数
1
解决办法
737
查看次数

如何刷新Kendo UI组合框?

我有一个ASP.Net MVC Kendo UI组合框,它被数据绑定到一个包含1000个记录的表.我已将MinLength属性设置为5,因此我只返回相关结果.问题是,用户可能需要一起更改文本值.有没有办法告诉控件刷新?

这是控件的代码......

@(Html.Kendo().ComboBoxFor(x => x.Product)
                    .Name("Product")
                    .DataTextField("Name") // Display value
                    .DataValueField("Id") //Return value
                    .MinLength(5)
                    .AutoBind(false)
                    .Suggest(true)
                    .Filter(FilterType.Contains)
                    .DataSource(source =>
                    {
                        source.Read(read =>
                        {
                            read.Action("Products", "Home").Data("onGetProducts");
                        });
                    })
                )
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc kendo-ui kendo-grid kendo-combobox kendo-asp.net-mvc

5
推荐指数
1
解决办法
1万
查看次数

动态刷新 KendoUI DropdownList

我有以下三个 KendoUI 下拉列表框;

    @(Html.Kendo().DropDownList()
    .HtmlAttributes(new { style = "width:auto;height:25px" })
    .OptionLabel("Make (any)") 
    .Name("Make") 
    .DataTextField("Name") 
    .DataValueField("MakeId")
    .DataSource(source =>
    {
           source.Read(read =>
           {
               read.Action("GetMakes", "Home"); 
           })
           .ServerFiltering(true); 
    })
    .SelectedIndex(0) 
    )

    @(Html.Kendo().DropDownList()
          .Name("Model")
          .HtmlAttributes(new { style = "width:auto;height:25px" })
          .OptionLabel("Model (any)")
          .DataTextField("Name")
          .DataValueField("ModelId")
          .DataSource(source => {
              source.Read(read =>
              {
                  read.Action("GetModels", "Home")
                      .Data("FilterModels");
              })
              .ServerFiltering(true);
          })
          .Enable(false)
          .AutoBind(false)
          .CascadeFrom("Make")

    )



    @(Html.Kendo().DropDownList()
          .Name("Fuel")
          .HtmlAttributes(new { style = "width:auto;height:25px" })
          .OptionLabel("Fuel type (any)")
          .DataTextField("Name")
          .DataValueField("FuelTypeId")
          .DataSource(source => {
              source.Read(read =>
              {
                  read.Action("GetFuelTypes", "Home")
                      .Data("FilterFuelTypes");
              })
              .ServerFiltering(true); …
Run Code Online (Sandbox Code Playgroud)

kendo-ui kendo-combobox

5
推荐指数
2
解决办法
2万
查看次数

Kendoui MVC EditorTemplateName在PopUp编辑模式下不起作用

我想在KendoUi网格中使用EditorTemplateName作为外键.

当网格编辑模式为InLine时,一切正常,我的模板已加载.但当更改模式为Popup时不加载模板.怎么解决呢?

@(Html.Kendo().Grid<Product>()
    .Name("grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.ProductId).Visible(false);
        columns.Bound(p => p.Title);

        columns.ForeignKey(p => p.CategoryId, new SelectList(ViewBag.CategoryySelectList, "Value", "Text"))
                   .EditorTemplateName("MyTemplate");

        columns.Command(cmd => cmd.Edit());
    })
    .Editable(edit => edit
        .Mode(GridEditMode.PopUp)
    )
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(15)
        .Events(events => events.Error("error_handler"))
        .Model(model =>
        {
            model.Id(p => p.ProductId);
        })
        .Read(read => read.Action("FillGrid", "Products"))
        .Update(update => update.Action("Edit", "Products"))
        .Destroy(destroy => destroy.Action("Delete", "Products"))
    )
)
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc kendo-ui kendo-grid kendo-combobox kendo-asp.net-mvc

4
推荐指数
1
解决办法
2万
查看次数

kendo ui在首次加载时选择一个指定索引/文本

我遇到的问题是,在第一次加载页面时我想从cookie中读取值,如果找到,我想更改存储在cookie中的主题.不仅想要更改它们,而且我还想在组合框中选择该项目,以便它与应用它们同步.

在构建组合框时,如何在初始页面加载期间选择特定项目?

$(document).ready(function () {

   var initialized = false;
        // theme chooser drop-down
        var cmb=$(".themeChooser").kendoDropDownList({
            dataSource: [
                    { text: "Default" },
                    { text: "BlueOpal" },
                    { text: "Bootstrap" },
                    { text: "Silver" },
                    { text: "Uniform" },
                    { text: "Metro" },
                    { text: "Black" },
                    { text: "MetroBlack" },
                    { text: "HighContrast" },
                    { text: "Moonlight" }
            ],
            dataTextField: "text",
            dataValueField: "value",
            change: function (e) {

                $.cookie('selectedTheme', theme);
                changeTheme(theme);

            }
        });

        theme = ($.cookie('selectedTheme') || "default").toLowerCase();
        //Not sure how to …
Run Code Online (Sandbox Code Playgroud)

javascript kendo-ui kendo-combobox kendo-dropdown

4
推荐指数
1
解决办法
1万
查看次数

在Kendo UI kendoComboBox对象中设置dataTextField值

我有一个像这样的Kendo UI组合框对象:

widget: "kendoComboBox",
            options: {
                dataTextField: "#:userFirstName#&nbsp#:userLastName#",
                dataValueField: "userId",

                template: "#:userFirstName#&nbsp#:userLastName#",
                change: function (e) {
                    that.model.fn.bringUserData();
                }
            }
Run Code Online (Sandbox Code Playgroud)

我可以安排模板,但我不能dataTextField值取决于该模板.可以将其设置为"userId"等.但似乎无法将所选值设置为#:userFirstName# #:userLastName#.(dataTextFieldTemplate不起作用.)

你能帮帮我解决这个问题吗?

kendo-ui kendo-combobox

2
推荐指数
1
解决办法
4126
查看次数

排序Kendocombobox的项目

我在我的应用程序中使用了一个Kendo ComboBox,代码如下:

$("#txtSetorOrigem").kendoComboBox({
    change : function (e) {
        if (this.value() && this.selectedIndex == -1) {                    
            alert('You must select a valid item');
            this.value('');
        }
    },
    filter : 'contains',
    dataTextField: "setorNome",
    dataValueField: "setorId",
    dataSource: [
        { setorNome: "bbb", setorId: 1 },
        { setorNome: "aaa", setorId: 2 },
        { setorNome: "eee", setorId: 3 },
        { setorNome: "ccc", setorId: 4 },
        { setorNome: "ddd", setorId: 5 }
    ],
    select: function(e) {
        var item = e.item;
        var text = item.text();
        $(".txtSelSetorOrigem").val(text);
        $(".txtSetorOrigem").val(text);
    }
});
Run Code Online (Sandbox Code Playgroud)

如何使用kendocombobox按项(setorNome)对此数据源进行排序? …

jquery kendo-ui kendo-combobox

2
推荐指数
1
解决办法
2416
查看次数