4

I'm currently using the ASP.NET MVC helpers in MVC4, with the Infragistics igGrid control, and am looking for a way to insert a custom column in order to implement AJAX calls for CRUD functionality. The only solutions that I've found involve exposing the entity which isn't an option in the current architecture. Essentially I just need to know how to add a new column that can contain a simple href to call an existing REST API that references the model on the specific row.

Here's what I have so far...

<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
....
Konstantin Dinev
  • 34,219
  • 14
  • 75
  • 100

2 Answers2

3

I would use the column template: 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");

Try that out as your column for delete.

Boone
  • 1,046
  • 1
  • 12
  • 30
0

In the upcoming release of the jQuery controls (2012.2 - coming really soon), you will be able to define an unbound column with which you will be able solve your case.

What @Boone is suggesting will be absolutely correct - the only difference is that instead of a data-bound column (ProductID in this suggestion), which will expose that column's values in the grid, you will be able to define a blank column.

You will then be able to define a template for that blank (data-unbound) column where you can place links, buttons or anything else you like for that matter.

Borislav T
  • 619
  • 4
  • 20