display.grid.unshift()



The unshift() method inserts a new record at the beginning of a grid.



Parameters

  1. JavaScript object to insert with properties representing fields in the grid

  2. One or more additional JavaScript objects to insert (optional)



Example

pjs.defineDisplay("display.json"); // assume display.json defines mygrid with fields named "product" and "description" display.mygrid.addRecords([ { product: 1, description: "ITEM ONE" }, { product: 2, description: "ITEM TWO" }, { product: 3, description: "ITEM THREE" }, { product: 4, description: "ITEM FOUR" } ]);   display.mygrid.unshift({ product: 0, description: "ITEM ZERO" });