I can't get it running. What i'am missing.
Create from VS2013 Template MVC Project.
Including the Infragistics folder (css and js)
Adding in the _Layout in the head section ...
<head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>@ViewBag.Title - xx-xx</title> @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") <script src="~/Scripts/jquery-1.10.2.min.js"></script> <script src="~/Scripts/jquery-ui-1.10.4.min.js"></script> <!-- This script reference is require by the Infragistics Loader rendered below --> <script src="@Url.Content("~/Infragistics/js/infragistics.loader.js")"></script></head>
and in the <body> ...
@(Html.Infragistics().Loader() .ScriptPath(Url.Content("~/Infragistics/js/")) .CssPath(Url.Content("~/Infragistics/css/")) .Render() )
After that in the (new Index - View) ...
@using Infragistics.Web.Mvc@model TheShopWeb.Areas.Analysis.Models.ClosedOrdersModel@{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_Layout.cshtml";}<head> <title></title></head>><body> <h2>Index</h2> @(Html.Infragistics().Grid(Model.ListOfOrdersClosed.AsQueryable()) .Width("400px") .DataBind() .Render() ) </body>
Look at your Content/css bundle and add the infragistics css for theme and structure.
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.min.css",
"~/Content/site.css",
"~/Infragistics/css/themes/infragistics/infragistics.theme.css",
"~/Infragistics/css/structure/infragistics.css"));
No it didn't work. Is there a chance to get a sample- somewhat just a application "out of the box MS-Template with a ig-grid? For dummies ...
... and if i do it with "Standard-MS" it works.
@using Infragistics.Web.Mvc@model TheShopWeb.Models.ClosedOrdersModel@{ ViewBag.Title = "ClosedOrders"; Layout = "~/Views/Shared/_Layout.cshtml";}<h2> ClosedOrders</h2>@{ var grid = new WebGrid(@Model.ListOfOrdersClosed, rowsPerPage: 20, columnNames: new[] { "customers_name", "payment_method" }, canPage: true);}@grid.GetHtml( fillEmptyRows: false, mode: WebGridPagerModes.All, columns: grid.Columns( grid.Column("customers_name", header: "customers_name"), grid.Column("payment_method", header: "payment_method") ))"
Yippie, great now it works - it renders the grid.
One thing left. If i try to do some sorting (or filtering), it throws
"Unhandled exception at line 35, column 28319 in http://localhost:52378/Infragistics/js/modules/infragistics.datasource.js0x800a138f - runtime error in BLOCKED SCRIPT Property "length" ...
the view is simple:
@(Html.Infragistics().Grid(Model.ListOfOrdersClosed.AsQueryable()) .ID("grid1") .PrimaryKey("orders_id") .Height("400px") .Width("100%") .AutoGenerateColumns(false) .AutoGenerateLayouts(false) .DefaultColumnWidth("150px") .Columns(column => { column.For(x => x.date_purchased).HeaderText("Datum").Width("10%").Format("dd.MM.yyyy"); column.For(x => x.orders_id).HeaderText("Best.-Nr").Width("10%"); column.For(x => x.payment_method).HeaderText("Zahlungsart").Width("20%"); column.For(x => x.customers_name).HeaderText("Kunde").Width("20%"); column.For(x => x.ot_subtotal).HeaderText("Zwischensumme").Width("10%").Format("c"); column.For(x => x.ot_total).HeaderText("Gesamt").Width("10%").Format("c"); }) .Features(features => features.Sorting().Type(OpType.Remote)) .DataSourceUrl(Url.Action("GetClosedOrders")) .DataBind() .Render() )
// // GET: /Analysis/ClosedOrders/ [GridDataSourceAction] public ActionResult GetClosedOrders() { if (MySession.Current.ClosedOrdersModel.ListOfOrdersClosed == null) MySession.Current.ClosedOrdersModel.CreateList(3, 2014); return View(MySession.Current.ClosedOrdersModel); }
Hi,
I will be happy to assist you.
Attached you will find a sample that demonstrates how you enable Remote Sorting for the igGrid. Please run the sample, compare it with your project, and let me know if you have any questions.
I am looking forward to hearing from you.
It didn't run. It throws:
JavaScript critical error at line 1, column 1 in http://cdn-na.infragistics.com/jquery/20132/latest/js/infragistics.core.js\n\nSCRIPT1014: Invalid Character
You may encounter this issue if you don't clear IE11 cache. Please use the Internet Options window to delete all cache files and try running the sample again.
Thanks. I had same problem. This fixed it.