We load 10 rows of static data into our jqGrid by creating a JSON string:
var d = "{\"page\":1,\"records\":10,\"total\":1,\"rows\":[" +
"{\"id\":\"1\",\"cell\":[\"\"]}," +
"{\"id\":\"2\",\"cell\":[\"\"]}," +
"{\"id\":\"3\",\"cell\":[\"\"]}," +
"{\"id\":\"4\",\"cell\":[\"\"]}," +
"{\"id\":\"5\",\"cell\":[\"\"]}," +
"{\"id\":\"6\",\"cell\":[\"\"]}," +
"{\"id\":\"7\",\"cell\":[\"\"]}," +
"{\"id\":\"8\",\"cell\":[\"\"]}," +
"{\"id\":\"9\",\"cell\":[\"\"]}," +
"{\"id\":\"10\",\"cell\":[\"\"]}" +
"]}";
And loading that into a grid with datatype:jsonstring
and datastr:d
where our grid has 15 columns and each column is created using a custom formatter.
Is there a better way to do this?