【问题标题】:Kendo UI Grid custom commandKendo UI Grid 自定义命令
【发布时间】:2014-07-08 18:45:03
【问题描述】:

我正在尝试设置一个按钮以使用 Kendo UI 网格回发到功能。当我单击我创建的按钮时,它只是为对象传递 null。这是我的代码...

 @(Html.Kendo().Grid<ModelObject>()
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(e => e.id);
        columns.Command(command => { command.Custom("do something").SendDataKeys(true).Click("functionName"); });
    })...

而 javascript 是...

function functionName(e) {
    $.ajax({
        type: 'POST',
        url: '@Url.Action("Action", "Controller")',
        data: { item: e },
        dataType: 'json',
        cache: false,
        success: function (result) { }
    });
}

【问题讨论】:

    标签: kendo-grid


    【解决方案1】:

    这个问题应该可以回答你的问题

    Kendo MVC Grid: Creating a Custom command button and passing parameters

    查看 javascript 解决方案的 cmets。

    如果您仍然遇到问题。让我知道,因为我有一个可能的解决方案,但这取决于您希望将什么作为您的对象发送回服务器。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-02-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多