You need to sign in to do that
Don't have an account?
raghu123
Creating hierarchical table
Hello Guys, I need to create hierarchical table like below. from single Custom Object.Visula force page contains Four lookup fields input fields.
Warehouse Product Serials Button
Product 1 0000-1 Warehouse 1 0000-2 Product2 0000-3 0000-4 |
Thaank You,
Raghu
r_boyd_848
I havn't needed to do collapsing rows yet. Thanks for the link to jQuery Grid. I'll check it out.
All Answers
Not possible with anything out of the VF toolkit. If you have used jQuery I recommend looking at jqGrid http://www.trirand.com/blog/. We've used it successfully on VF pages - although not its hierarchical features.
The alternative is to look at may be flex of force.com and see if there is plugin for this - we've never used the flex add-in perhaps someelse in the community might know
Hierarchical tables are fairly easy to do with Apex and Visualforce. You need to build a custom HTML table and style it to match the standard SFDC tables (if required).
You first need to build a class hierarchy in Apex that represents your data. I would guess you would have classes like this:
There are two important pieces of information that need to be calculated. Rowspan is the number of rows that will be generated to render a given object. IsFirst is set to true for the first product or serial in the collection. You need these to correctly render the Visualforce.
The Visualforce page would look something like this:
When your page loads it calls “warehouses”. You then build the object hierarchy and return your collection. The Visualforce iterates over the collection building the table one row at a time. The trick in the VF is to use rowspan in the warehouse and products columns. You only reference the warehouse and product cells once and let the rowspan do the work.
You can use this technique for data entry tables too. Just put set methods on your objects and have a Save method that iterates over the collection and issues insert/updates as required for new or modified values.
Thank You Andy..Great Info.:))
Nice one. Have you sprinkled it with javascript to allow the child rows to show/hide. We've done quite a bit with jqGrid on VF but just haven't had the need yet to use it's heirarchical features.
Andy,
I think there is no attribute like rowspan for <apex:outputText>
getting error Unsupported attribute rowspan in <apex:outputText> in SerialTransferClearBackorder
Thank You,
Raghu
r_boyd_848
I havn't needed to do collapsing rows yet. Thanks for the link to jQuery Grid. I'll check it out.