I have an ticket line grid, with a Total column, which is calculated (Qty x Price), using the total function in the model definition:
Note that I use a total function in the model definition instead of a template expression such as "#=Qty * price#" because I need it to also work in the custom edit form (which has a total field that needs to be dynamically updated when qty or price is changed).
Here is a plunker: http://plnkr.co/edit/YHiupWy49mvk4kZAqJTA?p=preview
I need to have a field outside of the grid that always reflects the grand total of the grid (=the total of the Total column). I have put a place holder below the grid in the plunker, Grand Total; this is where the total should show.
How can I do this, preferably in an AngularJS way?
Thanks,
Lars
schema: { model: { id: "id", fields: { id: { type: "string" }, orderId: { type: "number" }, lineNo: { type: "number" }, itemNo: { type: "string" }, ... price: { type: "number" }, qty: { type: "number" }, comment: { type: "string" }, }, total: function () { return (this.get("qty") * this.get("price")).toFixed(2); } }}Note that I use a total function in the model definition instead of a template expression such as "#=Qty * price#" because I need it to also work in the custom edit form (which has a total field that needs to be dynamically updated when qty or price is changed).
Here is a plunker: http://plnkr.co/edit/YHiupWy49mvk4kZAqJTA?p=preview
I need to have a field outside of the grid that always reflects the grand total of the grid (=the total of the Total column). I have put a place holder below the grid in the plunker, Grand Total; this is where the total should show.
How can I do this, preferably in an AngularJS way?
Thanks,
Lars