working jqGrid Example

by KevinGabbert

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/themes/base/jquery-ui.css">
<link rel="stylesheet" href="http://trirand.com/blog/jqgrid/themes/ui.jqgrid.css">
<script src="http://trirand.com/blog/jqgrid/js/i18n/grid.locale-en.js"></script>
<script src="http://trirand.com/blog/jqgrid/js/jquery.jqGrid.min.js"></script>
<table id="rulesDefTable"></table>

JavaScript

/* PieceDef Grid Test for ChessMangler */    

var _rulesDef = {
    "ChessConfig": {
        "version": "CM2 pre-alpha",
        "game": "Chess",
        "Board": {
            "twoD": {
                "type": "tetragon",
                "columns": "8",
                "rows": "8",
                "SpotDef": {
                    "coordinate" : "-1",
                    "length" : "100",
                    "width" : "100"
                }
            }
        },
        "PieceDefs": [
            {
                "type": "Starting FEN",
                "FEN": "8/8/p6k/2R5/3p4/P7/1P1rNK2/8 b - - 1 38"
            },
            {
                "type": "Multiple",
                "subtype": "FillRank",
                "FENCode": "P",
                "namePrefix": "WhitePawn",
                "startingaRank": "2",
                "player": "White",
                "imageName": "images/chessPieces/Chess.Merida/wp.png",
                "Movement":[ 
                   {
                     "condition": {
                         "type": "Not Out of Bounds"
                   }
                }],
                "Capture": [{
                    "condition": {
                          "type": "Not own Piece"
                    }
                },
                {
                    "condition": {
                          "type": "Replace Opposing Piece"
                    }
                }]
            },
            {
                "name": "WhiteRookLeft",
                "FENCode" : "R",
                "startingSpot": "A1",
                "coordinate": "spot-8-1",
                "player": "White",
                "pieceType": "unicode",
                "chessFontCharacter": "♖"
            },
            {
                "name": "WhiteKnightLeft",
                "startingSpot": "A1",
                "coordinate": "spot-8-2",
                "player": "White",
                "imageName": "images/chessPieces/Chess.Merida/wn.png"
           ...