customize table

Thanks Hugh,
I have changed the template file as bellow:
Code:
<?php /**
 * @package  fabrik
 * @version 905 | fabrik_cheesegrits | 2008-05-19 21:21:05 +0200 (Mon, 19 May 2008
 * @Copyright (C) Rob Clayburn
 * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
 */
/* MOS Intruder Alerts */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
?>

<h1><?php echo $this->table->label;?></h1>
<div><?php echo $this->table->intro;?></div>
<form action="<?php echo $this->table->action;?>" method="post" id="<?php echo $this->formid;?>" name="fabrikTable">
<?php if ($this->showAdd) {?>
	<span class="pagenav">
		<a href="<?php echo $this->addRecordLink;?>"><?php echo _ADD_RECORD;?></a>
	</span>
<?php }?>
<?php if ($this->showCSV) {?>
	<span class="pagenav">
		<a href="<?php echo $this->csvLink;?>"><?php echo _EXPORT_TO_CSV;?></a>
	</span>
<?php }?> 
<?php if ($this->showRSS) {?>
	<span class="pagenav">
		<a href="<?php echo $this->rsslink;?>"><?php echo _SUBSCRIBE_RSS;?></a>
	</span>
<?php }?>
<?php if ($this->showFilters) {?>
<table class="filtertable">
	<tr>
		<th style="text-align:left"><?php echo _SEARCH;?>:</th>
		<th style="text-align:right"><a href="#" class="clearFilters"><?php echo _CLEAR ?></a></th>
	</tr>
	<?php foreach ($this->filters as $filter) {?>
	<tr>
		<td><?php echo $filter->label;?></td>
		<td style="text-align:right;"><?php echo $filter->element;?></td>
	</tr>
	<?php } ?>
	<?php if ($this->filter_action != 'onchange') {?>
	<tr>
		<td colspan="2" style="text-align:right;">
		<input type="button" class="button" value="<?php echo _GO;?>" name="filter" />
		</td>
	</tr>
	<?php }?>
</table>
	<?php }?> <br style="clear:both;" />
<br />
	<?php if (count( $this->rows ) == 0) {?>
		<div class="emptyDataMessage"><?php echo $this->emptyDataMessage;;?></div>
	<?php } else {
		/* foreach ($this->rows as $gkey => $group) {?>
		<table class="fabrikTable">
			<tr>
			<?php foreach ($this->headings as $heading) {?>
				<th><?php echo $heading;?></th>
				<?php }?>
			</tr>
			<?php
			$c = 0;
			foreach ($group as $rkey => $row) { ?>
				<tr class="oddrow<?php echo $c;?> <?php echo implode(' ',$this->rowClasses[$gkey][$rkey]); ?> ">
				<?php
				foreach ($this->headings as $heading=>$label) { ?>
					<td class="<?php echo $this->cellClasses[$gkey][$rkey][$heading];?>"><?php  echo($row->$heading);?></td>
				<?php }?>
				</tr>
				<?php $c = 1-$c;
			}
		}?>
		<?php */
foreach ($this->rows as $gkey => $group) {?>
        <table class="fabrikTable">
            <tr>
                <?php foreach ($this->headings as $heading) {?>
				<th><?php echo $heading;?></th>
				<?php }?>
            </tr>
            <?php
            $c = 0;
   foreach ($group as $rkey => $row) {?>
      <tr class="oddrow<?php echo $c;?> <?php echo implode(' ',$this->rowClasses[$gkey][$rkey]); ?> ">
        <td class="<?php echo $this->cellClasses[$gkey][$rkey][$heading];?>">
           <?php echo($row->jos_fabrik_formdata_20___ac_unit_1);?></td>
        </td>
      </tr>
<?php
      $c = 1-$c;
   }
}?> 
		<tr class="fabrik_calculations">
		
		<?php
		foreach ($this->calculations as $cal) {
			echo "<td>" . $cal->calc ."</td>";
		}
		?>
		</tr>
	</table>
<?php }
if ($this->canDelete) {?>
<label>
	<input type="checkbox" id="table_<?php echo $this->table->id;?>_checkAll" />
	<?php echo _CHECK_ALL;?>
</label>
<?php 
}
print_r($this->hiddenFields);?>
<?php 
echo $this->nav;
echo $this->deleteButton;
echo "&nbsp;" . $this->emptyButton;
?>
</form>
But the related table is : http://www.mmg-co.ir/web/index.php?option=com_content&task=view&id=15&Itemid=
could you please help me more?

secondly, as a alternative solution,is there any way to make only one submit button in a multi form which made by formbot.as soon as pressing the submit button all the forms will be submitted instead of pressing each form buttons.
 
I'm slightly swamped at the moment, with Rob being away. I'll get to this as soon as possible.

Meanwhile, re-read my previous post. You still haven't REPLACED the similar loop with the new code.

-- hugh
 
Hugh,
I have Replaced the similar loop with new code,it is clear in my previous post,but it doesn't work completely.i have to set show in table view for all the elements in the table and i can't show some of the elements in table.if don't set that,the elements which i want to show in table will not appear in the table and the replaced code will be useless.
can you think little bit about my 2nd question? it is a better and easier solution for me.
unfortunately still i haven't got any result from the beginning and subscribing on this forum.
 
No, it's not possible to submit multiple forms with one button - this isn't a Fabrik limitation, it's an HTML limitation.

I'm still totally confused about what you are trying to do with the table layout.

Do you have any IM access? If so, IM me so I can ask questions while I browse the site. Skype, MSN or Yahoo, icons to the left of any of my posts should give you my contact details.

-- hugh
 
Let me explain you more,
I have made several form and each form is include some group.i want to show each group (instead of all the group in the form) in one table.

I believe there is two way to do that,first create custom layout for each group which every layout show only the related group.so the groups in the tables can be filtered with using tablebot mambot and specify the layout.
2nd solution is creating multiply form with only one submit button.each form is include one group and no need to custom table layout.

i will be in contact with you with Yahoo messenger IM.

thanks.
 
The problem, as Rob said earlier, is that when rendering tables, there is no "Group" information available. In Fabrik as it stands, Groups are only applied in Forms. The table code doesn't have any idea what Group a given element belongs to. This is perhaps a shortcoming in the code, but it is what it is. :(

It really sounds like you need to be dealing with separate forms / tables.

FYI, I'm on US Central time (GMT-6), I'm usually around from about 10am to 1am, although two or three evenings a week I'm out playing music. I saw your IM this morning, sorry I missed you.

-- hugh
 
Yes,I understand what rob said and i don't want to render the tables by group information.
i mean about group is group of elements and each element would be in the template code.

I would like to use separate form / table , and it is possible to collect multi form in same page,but as you said there is no way to submit them in same time.is it possible to combine some different form in a same form? and all the form will be submitted in same time.

As you and rob guide me i could edit the tables template and make appear some of the elements which are in same group in the table.but it is possible if show in table view was set so i have to make all of them to set,and all elements will be appear in the table regardless of those elements has been defined in the template or not.so actually the replacement codes is useless.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top