如何在kendo ComboBox中设置值

时间:2018-04-18 03:01:36

标签: javascript kendo-grid kendo-combobox

我试图为组合框设置值,它在页面上正确显示,但是options.models没有得到。任何人都可以帮助我..非常感谢

dataSource: {
        batch: true,
        columns:{
            { field: "cluster_name", editor: myEditor},
        }
        transport: {
            create: {
                url: "127.0.0.1/create",
                dataType: "jsonp",
            }
            paramterMap: function(options, operation){

                if (operation == "create"){
                    console.log(options.models) ;// no value 
                    return {models: kendo.stringify(options.models);
                }
            }
        }
    }
    function myEditor(container, options){
    .appendTo(container)
    $('<input name="' + options.field +'"/>')
    .kendoComboBox({
        dataTextField : "id",
        dataValueField: "name",
        dataSource: [
            { "id": "yes", "name": "yes"},
            {"id": "no", "name": "no"}
        ]
    })
}

    var combox = $('#mygrid').data("kendoComboBox");
    combox.value("yes"); //page is correctly, options.models doesn't get.

0 个答案:

没有答案