Created
March 15, 2010 22:44
-
-
Save chadmyers/333433 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is an example of one of the types of objects | |
// that'll get put into the "items" property of the | |
// GridResultsViewModel DTO above | |
// Each "item" is a row. That is, each EntityDTO is a | |
// row in the grid | |
// the "cells" property is what gets bound to the | |
// cells in each row | |
// It's up to you to get the display value for each cell | |
public class EntityDTO | |
{ | |
public Guid id { get; set; } | |
public string[] cell { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GridResultsViewModel | |
{ | |
public int total { get; set; } | |
public int lastpage { get { return total; } set { } } | |
public bool viewrecords {get{ return true;} set {}} | |
public int page { get; set; } | |
public int records { get; set; } | |
public IEnumerable items { get; set; } | |
public string Description { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a snippet of the options we pass to | |
// jqGrid. We have a bunch of events bound, but | |
// that wouldn't be interesting to you | |
height: "auto", | |
url: gridDefinition.Url, | |
datatype: 'json', | |
mtype: 'GET', | |
readjustHeaderWidths: true, | |
colNames: columnNames, | |
colModel: columnModel, | |
rowNum: 10, | |
rowList: [3, 10, 20, 30], | |
loadui: "disable", | |
postData: initalPostData, | |
sortorder: "asc", | |
viewrecords: true, | |
jsonReader: { | |
repeatitems: true, | |
root: "items", | |
cell: "cell", | |
id: "id" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment