Custom Table Layout Template

Status
Not open for further replies.

LeberMac

New Member
Alright, here's a doozie. I've been banging my head against the wall for a while trying to get this to work perfectly. I've managed to hack something together with some custom templates, and I've nailed the individual record view. However, I need a little help with the initial form template, and I hope this might be relatively simple to solve.

Here's what I'd like to have as the initial table view:
example_plain.jpg


I envision the standard view HTML "table" layout to be something like this, with both the filtertable AND the datatable in the same HTML table:
example_with_tablegrid.jpg


The filtertable is actually ROW 2 of the entire layout:
example_hilight_filtertable.jpg


The tableheader row is on top, and the table element rows are beneath the filtertable:
example_hilight_table.jpg


[EDIT] Looks like fabrikar.com crashed just as I posted this... hope I didn't break anything...[/EDIT]

Anyway, essentially what I'm looking for is the ability to customize the standard table layout as easily as I can customize the standard viewonly template, using the same kind of layouts like, for example {GROUP1_BOOKNAME} variable settings. Like I found out about in this thread, here:
http://fabrikar.com/index.php?option=com_smf&Itemid=9&topic=27.0

Something like this, admittedly this is very rough but perhaps it would give you an idea:
Code:
<table>
<th>
<td>{GROUP1_BOOKNAME_HEADER}</td><td>{GROUP1_TYPE_HEADER}</td><td>{GROUP1_AUTHOR_HEADER}</td><td>{GROUP1_PAGES_HEADER}</td>
</th>
<tr>
<td><input type="button" onclick="submitfabrikTable('filter')" class="button" value="Search" name="filter" />{GROUP1_BOOKNAME_HEADER}</td><td>{GROUP1_TYPE_HEADER}</td><td>{GROUP1_AUTHOR_HEADER}</td><td>{GROUP1_PAGES_HEADER}</td>
</tr>
<mos:sub condition="__default">
<tr class="oddrow{PAT_IS_EVEN}">
<mos:tmpl name="cell">
<td><mos:var name="value" /></td>
</mos:tmpl>
</tr>
</mos:sub>

I can't style the table elements since they all have the same value, I'd just like things to all line up in a table and then have individual css control over the columns somehow.

Right now the source code for the individual data rows is like this:
Code:
<tr class="oddrow0">
<td><a href='[url]http://www.site.com/index.php?option=com_fabrik&amp;task=viewTableRowDetails&amp;Itemid=88&amp;fabrik=7&amp;rowid=13&amp;tableid=7'>BookName[/url] 01</a></td>
<td>Fiction</td>
<td>John Smith</td>
<td>235</td>
</tr>

It would be great if I could find a way to individually style the columns, too, but that is not super important.

Just a hint or two would be great. I managed to turn the filtertable on its side just fine (Thanks, Rob!), and I used some CSS overlay tricks to make the filtertable appear to be row #2 and the table header to appear above the filtertable, but the columns don't line up properly, which is why I'm asking about a method to put them into the same table.
 
Hi

You can use the "named-template" template to access individual records, such replacing :

Code:
<mos:sub condition="__default">
<tr class="oddrow{PAT_IS_EVEN}">
<mos:tmpl name="cell">
<td><mos:var name="value" /></td>
</mos:tmpl>
</tr>

Code:
<mos:tmpl name="named-rows">
<tr>
<td>{JOS_FABRIK_FORMDATA_1.NAME}</td>
<td>{JOS_FABRIK_FORMDATA_1.TYPE}</td>
<td>{JOS_FABRIK_FORMDATA_1.AUTHOR}</td>
<td>{JOS_FABRIK_FORMDATA_1.PAGES}</td>
</tr>
</mos:tmpl>

That should give you enough info to create exactly whatever layout you need
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top