I would like to know if the jQuery library can be extended using C# code. I want to write html extension helpers for the igGrid, etc..
I want to be able to create this code using c#. How can I do that?
@(Html.Infragistics().Grid(Model).ID("grid2").Columns(column => { column.For(x => x.ProductID).HeaderText(this.GetGlobalResourceObject("igGridResources", "PRODUCT_ID").ToString()).Width("100"); column.For(x => x.Name).HeaderText(this.GetGlobalResourceObject("igGridResources", "PRODUCT_NAME").ToString()).Width("250px"); column.For(x => x.ProductNumber).HeaderText(this.GetGlobalResourceObject("igGridResources", "PRODUCT_NUMBER").ToString()).Width("150px"); column.For(x => x.StandardCost).HeaderText(this.GetGlobalResourceObject("igGridResources", "STANDARD_COST").ToString()).Width("200px"); }).Features(features => { features.Paging().PageSize(12).PrevPageLabelText(this.GetGlobalResourceObject("igGridResources", "PREVIOUS").ToString()).NextPageLabelText(this.GetGlobalResourceObject("igGridResources", "NEXT").ToString()); features.Sorting().Mode(SortingMode.Single).ColumnSettings(settings => { settings.ColumnSetting().ColumnKey("ProductID").AllowSorting(true); }); // this sample also shows custom RowTemplate functionality }).RowTemplate( "<tr><td> ${ProductID} </td><td> ${Name} </td> <td> <span style=\"color:green;\"> Serial</span> : ${ProductNumber} </td> <td> ${StandardCost} </td> </tr>" ).DataSourceUrl(Url.Action("ChainingGetData")).DataBind().Render() )
Hi,
if you would like to configure your grid in the controller, as opposed to the view, you can refer to the following example:
http://samples.infragistics.com/jquery/grid/paging
In general, everything which can be configured in the view using Chaining, can be also configured using the GridModel classes. You can also extend them to add extra functionality. You can refer to the following docs:
http://help.infragistics.com/Help/NetAdvantage/jQuery/2011.2/CLR4.0/html/Infragistics.Web.Mvc~Infragistics.Web.Mvc_namespace.html
Hope it helps. Thanks,
Angel