Joomla 单击时JToolbar前端提交值
我正在构建joomla组件,但找不到以下问题的解决方案。在我的前端,我正在使用joomlas内置类JToolbar来处理单击事件,比如编辑、删除so oneJoomla 单击时JToolbar前端提交值,joomla,components,frontend,jtoolbar,Joomla,Components,Frontend,Jtoolbar,我正在构建joomla组件,但找不到以下问题的解决方案。在我的前端,我正在使用joomlas内置类JToolbar来处理单击事件,比如编辑、删除so one <form action="<?php echo JRoute::_('index.php');?>" method="post" name="termForm" id="adminForm"> <table class=
<form action="<?php echo JRoute::_('index.php');?>" method="post"
name="termForm" id="adminForm">
<table class="stripeMe">
<tbody>
<thead>
<tr>
<th>Begriff</th>
<th>Definition</th>
<?php if ($user->authorize('com_glossary', 'edit', 'glossary', 'all')): ?><th>Published</th> <?php endif; ?>
</tr>
</thead>
<?php foreach($this->items as $i => $item): ?>
<tr>
<td>
<span class="title"><?php echo $item->tterm; ?></span>
<?php if ($user->authorize('com_glossary', 'edit', 'bearbeiten', 'all')):?>
<?php echo $this->getEdit(); ?><?php endif; ?>
</td>
<td><?php echo $item->tdefinition; ?></td>
<?php if ($user->authorize('com_glossary', 'edit', 'bearbeiten', 'all')): ?>
<td><?php echo $this->getPublished(); ?></td> <?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div>
<input type="hidden" name="task" value="" /> <input type="hidden"
name="id" value="" onclick="submitbutton(<?php echo count( $item->id ); ?>);" /> <input type="hidden"
name="option" value="com_glossary" /> <input type="hidden"
name="controller" value="bearbeiten" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
这里有一些关于在前端使用JToolbar的有用提示
我过去曾经做过一次,从我记忆中我做了一些技巧来让它发挥作用
1.)首先删除“id”输入,并在表单末尾添加以下内容:
<input type="hidden" name="boxchecked" value="0" />
2.)其次,确保Mootools已连接到源
3.)最后:在开始foreach循环的地方,在“tr”标记后添加另一个表列:
<td><?php echo JHTML::_('grid.id', $i, $item->id ); ?></td>
别忘了在中为该列创建一个列标题
这些步骤将在每行的第一个单元格中创建一个复选框,并使表单能够通过请求发送所选字段的id
编辑:
t车身标签位置错误,应该在标签后面。此外,将事件附加到隐藏输入也没有用,因为它们不会被触发
干杯
彼得是的,我也尝试过,但即使这样,我还是从循环中得到了最后一个值。