jenC - Friday, July 22, 2011 11:08 AM:
Is it possible to have a summary row in a grid view?
For example, we are storing our contract budgets. There is an initial budget, and then Mods come in to modify the contract value. The true value of the contract is the sum of all the mods. So I would want my grid to look something like the following (way simplified of course)
| Mod | Budget Hours | Budget Value |
|---|---|---|
| -- | 1000 | $10,000 |
|
|
||
| 0 | 500 | $5,000 |
| 1 | 200 | $2,000 |
| 2 | 300 | $4,000 |
Any suggestions on the best way to accomplish this?
Brian - Saturday, July 23, 2011 9:49 AM:
Hi Jen,
Off hand I can think of a couple of ways of doing this or something similar.
Use Federated fields in the Main item (not for the grid view) and update them with an onAfterGet server event. This is pretty easy to do and leaves the grid as completely standard.
Add a row to the grid but then you might want to delete it again before the data is saved. Using the onInsertRow of the Relationship Type Grid events you could react to a new row and ask the user if they wanted the new row to be a summary row. Then add details to the Item xml document for the new Row. This I see as being a little cumbersome and slightly annoying since you would have to ask the question each time a row was added.
Use a completely custom form instead of the standard relationship grid. Go to relationship type "Relationship views" and specify either a Form name for a form that you have built inside Innovator or an HTML page (Start page) if you are using an external HTML file.
The last option is probably the most complex but also gives you the most control over the result. You can build the form in Innovator and put the entire grid etc in an HTML field on the form. This keeps it all in the context of the form. See the Multi-level BOM tools form for a good example of a way of doing this.
The first option (federated fields) could be achieved in under 30 mins.
The last option, depending on how comfortable someone was with the HTML and javascript used as a template could take a day or more of solid effort. An experienced person could probably modify the existing code in 3-4 hours.
Hope this helps.
Cheers,
Brian.
jenC - Tuesday, July 26, 2011 11:59 AM:
Thanks for your response Brian.
Now I'm thinking of something else... What about a treeview instead? So by default, they would only see the summary row, they could expand the tree and then get to the detail rows? And if you added a new row, it would be a detail row.
Is there an easy way to do a treeview in Innovator? We're on 8.1 still (hopefully upgrading soon!)
Brian - Tuesday, July 26, 2011 7:06 PM:
Hi Jen,
You can certainly do it in a TreeView.
You have two basic options:
Build the treeView inside an HTML field on a standard form or use an external HTML page.
In the end it is very much like doing a custom grid. If you want a good example of an approach to a Multi Level Grid/Treeview have a look in the Demo database for form "Part plme MultiLevel BOM Grid" or for a less generic approach at form "Multi-BOM Tools Form" which is loaded as part of the Multi Level BOM tools community project.
If you need other assistance putting this together please send me an email at [email protected]
Cheers,
Brian.