Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1415
Can't get grid working at all
posted

I have reduced my sample as far as I can.. I get a jacascript error in the console when I run it, and the grid appears with column headings but no data:

Exception was thrown at line 1864, column 2 in http://localhost:56929/Scripts/jquery-1.10.2.js

0x800a139e - JavaScript runtime error: Syntax error, unrecognized expression: unsupported pseudo: jqmData

@{

ViewBag.Title = "CSM Tax Report";

}

@using Infragistics.Web.Mvc

@using TrackerMvc.Models.ClientTrackerDataModel.Reports

@model IQueryable<FormsByClient>

<div>

<link href="@Url.Content("~/Content/themes/infragistics/infragistics.theme.css")" rel="stylesheet" />

<link href="@Url.Content("~/Content/structure/infragistics.css")" rel="stylesheet" />

@section scripts {

<script src="@Url.Content("~/igniteui/js/infragistics.core.js")">script>

<script src="@Url.Content("~/igniteui/js/infragistics.lob.js")">script>

<script src="~/igniteui/js/infragistics.loader.js" type="text/javascript">script>

<script type="text/javascript">

$.ig.loader({

scriptPath: '@Url.Content("~/igniteui/js/")',

cssPath: '@Url.Content("~/igniteui/css/")',

resources: "igGrid.Sorting"

});

script>

@(Html.Infragistics()

.Grid<FormsByClient>(Model)

.ID("Grid")

.Height("500px")

.Width("100%")

.AutoGenerateColumns(false)

.AutoGenerateLayouts(true)

.RenderCheckboxes(true)

.ResponseDataKey(null)

.Columns(column =>

{

column.For(x => x.FileCompID).HeaderText("File Comp ID").Width("35%");

column.For(x => x.FiledMethodId).HeaderText("Filed Method ID").Width("65%");

})

.DataSourceUrl(Url.Content("~/ct/FormsByClientJson/1/2015/C"))

.Render()

)

}

div>

private GridModel GridLoadOnDemandModel()

{

// Define the Categories layout

GridModel grid = new GridModel();

grid.AutoGenerateLayouts = true;

grid.AutoGenerateColumns = false;

grid.Width = "100%";

grid.PrimaryKey = "FileCompID";

grid.Columns.Add(new GridColumn() { HeaderText = "FileCompID", Key = "FileCompID", DataType = "number", Width = "15%" });

grid.Columns.Add(new GridColumn() { HeaderText = "FiledMethodId", Key = "FiledMethodId", DataType = "number", Width = "85%" });

return grid;

}

[Route("FormsByClientJson/{id:int}/{fileyear:int}/{filetype:alpha}")]

public JsonResult FormsByClientJson(int id, int fileyear, string filetype)

{

GridModel model = GridLoadOnDemandModel();

model.DataSource= new List<FormsByClient>()

{

new FormsByClient() { FileCompID = 1, FiledMethodId = 10 },

new FormsByClient() { FileCompID = 2, FiledMethodId = 20 }

}.AsQueryable();

return model.GetData();

}

namespace TrackerMvc.Models.ClientTrackerDataModel.Reports

{

public class FormsByClient

{

public int FileCompID { get; set; }

public int FiledMethodId { get; set; }

}

}

JSON Returned by Datasourceurl =

{"Records":[{"FileCompID":1,"FiledMethodId":10},{"FileCompID":2,"FiledMethodId":20}],"TotalRecordsCount":0,"Metadata":{"timezoneOffset":-21600000}}

Parents Reply Children
No Data