1

我有一个带有弹出可编辑属性的 Kendo UI 网格。当我处于添加/编辑模式时,我想让我的下拉列更宽,但我似乎无法更改宽度。我确实可以更改网格本身的宽度,但不能在编辑模式下。

它与某种编辑模板有关吗?我找不到它的文档。

谢谢。鲍勃

这是我的示例网格:

       positGrid = $("#positGrid").kendoGrid({
        dataSource: datasource,
        toolbar: [
            { name: "create", text: "Add Position" }
        ],
        columns: [{
            field: "PositionId", 
        },
        {
            field: "Portfolio", 
            editor: portfolioDropDownEditor, template: "#=Portfolio#"
        },
        {
            field: "Instrument",
            width: "220px",
            editor: instrumentsDropDownEditor, template: "#=Instrument#", 
        },
        {
            field: "NumOfContracts",
        },
        {
            field: "BuySell",
            editor: buySellDropDownEditor, template: "#=BuySell#"
        },
        {
            command: [
              {
                  name: "edit",
                  click: function (e) {           
                  }
              },
              "destroy"
            ]
        },
        ],
        sortable: true,
        editable: "popup",
    });
4

1 回答 1

1

You can wire up edit event to set dropdown options:

name: "edit",
    click: function (e) {  
        if (!e.model.isNew()) {         
            var dropdown = e.container.find("input[name=Portfolio]").data("kendoDropDownList");
            dropdown.list.width(500);
        }
        }
于 2013-11-01T02:16:25.483 回答