simon551 Posted August 20, 2007 Share Posted August 20, 2007 Hi, I'm using php to generate spry xml data for a sortable report. and I'm wondering if anybody knows how to do a little math on the data. I just want to total a column. this is my repeat, sortable, column: <td>{rTotal}</td> I'd like to have another field in a new row (after all the repeat obviously with something like this: <tr> <td>{sumTotal}</td> </tr> I haven't found any documentation on working with the data. do I need to learn xQuery to be able to do this? thanks in advance -s This is my full code: <script src="../SpryAssets/xpath.js" type="text/javascript"></script> <script src="../SpryAssets/SpryData.js" type="text/javascript"></script> <script type="text/javascript"> <!-- var dsTr = new Spry.Data.XMLDataSet("sources/get_tr_byContract_entryDets.php", "entries/entry",{sortOnLoad:"aName",sortOrderOnLoad:"ascending"}); dsTr.setColumnType("tsdate", "date"); dsTr.sort("tsdate"); //--> </script> </head> <body> <div spry:region="dsTr"> <table> <tr class="tableheader"> <th spry:sort="tsdate">Date</th> <th spry:sort="employee">Employee</th> <th spry:sort="aName">Activity</th> <th spry:sort="sowCategory">Category</th> <th spry:sort="rTotal">Time</th> <th spry:sort="description">Description</th> </tr> <tr spry:repeat="dsTr" spry:odd="d1" spry:even="d0"> <td>{tsdate}</td> <td>{employee}</td> <td>{aName}</td> <td>{sowCategory}</td> <td>{rTotal}</td> <td>{description}</td> </tr> <tr> <td>THIS IS WHERE I WANT TO HAVE THE TOTAL</td> </table> </div> </body> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.