【问题标题】:Infragistics MVC Helper Custom ColumnInfragistics MVC Helper 自定义列
【发布时间】:2012-09-28 23:00:12
【问题描述】:

我目前正在使用 MVC4 中的 ASP.NET MVC 帮助程序,以及 Infragistics igGrid 控件,并且正在寻找一种插入自定义列的方法,以便为 CRUD 功能实现 AJAX 调用。我发现的唯一解决方案涉及公开在当前架构中不是选项的实体。本质上,我只需要知道如何添加一个可以包含简单 href 的新列,以调用引用特定行上的模型的现有 REST API。

这是我目前所拥有的......

<div class="queue-grid">
@( Html.Infragistics().Grid(Model).Columns( c =>
 {
     c.For(m => m.DateSubmitted).HeaderText...
     c.For(m => m.RequestorName).HeaderText...
     c.For(m => m.OrganizationName).HeaderText(...
     c.For(m => m.CategoryName).HeaderText(...
     c.For(m => m.DesiredCompletionDate).HeaderText(...
     c.For(m => m.ChargeCode).HeaderText(...
     c.For(m => m.ApprovingManagerName).HeaderText(...
     c.For(m => m.Description).HeaderText(...
     c. //Edit function
     c. //Delete function
....

【问题讨论】:

    标签: jquery asp.net-mvc infragistics ignite-ui iggrid


    【解决方案1】:

    在即将发布的 jQuery 控件(2012.2 - 即将推出)中,您将能够定义一个未绑定的列来解决您的问题。

    @Boone 的建议绝对正确 - 唯一的区别是,您可以定义一个空白,而不是数据绑定列(此建议中的 ProductID),它将在网格中公开该列的值列。

    然后,您将能够为该空白(未绑定数据)列定义一个模板,您可以在其中放置链接、按钮或任何其他您喜欢的东西。

    【讨论】:

      【解决方案2】:

      我会使用列模板:http://www.infragistics.com/products/jquery/sample/grid/basic-column-template

      column.For(x => x.ProductID).HeaderText("Delete").Template("<a href=javascript:DeleteProduct('${ProductID}');>Delete</a>").Width("150");
      

      尝试将其作为删除列。

      【讨论】:

        猜你喜欢
        • 2010-10-17
        • 1970-01-01
        • 1970-01-01
        • 2011-06-25
        • 2023-03-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-08-11
        相关资源
        最近更新 更多