Categories
CMS Joomla Mastering Development

Retrieve the value of a line a checkbox

I’m blocking on retrieving an item from a data list.
My code:

<div id="contenu2" class="content">
<div>
<form action="" method="post" id="adminForm" name="adminForm">
    <table class="table table-striped table-hover">
        <thead>
            <tr>
            <th class="k2ui-center<?php if($context == "modalselector") echo ' k2ui-not-visible'; ?>"><input id="k2<?php echo $this->params->get('backendListToggler', 'TogglerStandard'); ?>" type="checkbox" name="toggle" value="" /></th>
                <th width="1%"><?php echo JHtml::_('grid.sort', 'ID', 'id', $this->sortDirection, $this->sortColumn); ?></th>
                <th width="2%"><?php echo JHtml::_('grid.sort', 'Name', 'name', $this->sortDirection, $this->sortColumn); ?></th>
                <th width="2%"><?php echo JHtml::_('grid.sort', 'Published', 'published', $this->sortDirection, $this->sortColumn); ?></th>
            </tr>
        </thead>
        <tbody>
            <?php  if (!empty($this->items)) :  ?>
            <?php foreach ($this->items as $i => $row) : ?>
            <tr>
            <td class="k2ui-center<?php if($context == "modalselector") echo ' k2ui-not-visible'; ?>"><?php $row->checked_out = 0; echo @JHTML::_('grid.checkedout', $row, $key ); ?></td>
                <td align="center"><?php echo $row->id; ?></td>
                <td><?php echo $row->name; ?></td>
                <td align="center"><?php  echo JHtml::_('jgrid.published', $row->published, 'k2toflexi', true, 'cb'); ?></td>
            </tr>
            <?php endforeach; ?>
            <?php endif; ?>
        </tbody>
        <tfoot>
            <tr>
                <td colspan="5"><?php echo $this->pagination->getListFooter(); ?></td>
            </tr>
        </tfoot>
    </table>
    <input type="hidden" name="boxchecked" value="0" />
    <input type="hidden" name="filter_order" value="<?php echo $this->sortColumn; ?>" /> <!-- Todo: 404 composant introuvable -->
    <input type="hidden" name="filter_order_Dir" value="<?php echo $this->sortDirection; ?>" />
    <input type="hidden" name="task" value="" /> <!-- Probably useless -->
    <input type="hidden" name="boxchecked" value="0" />
    <?php if($context == "modalselector"): ?>
    <input type="hidden" name="context" value="modalselector" />
    <input type="hidden" name="tmpl" value="component" />
    <input type="hidden" name="fid" value="<?php echo JRequest::getCmd('fid'); ?>" />
    <input type="hidden" name="fname" value="<?php echo JRequest::getVar('fname'); ?>" />
    <input type="hidden" name="output" value="<?php echo JRequest::getCmd('output'); ?>" />
    <?php endif; ?>
    <?php echo JHTML::_('form.token'); ?>
    <input type="submit" name="tmpl" value="component" />
</form>
</div>

What I’m trying to do is get the line value if it is checked
I found this line in several components:

<? Php $ row-> checked_out = 0; echo @JHTML :: _ ('grid.checkedout', $ row, $ key); ?>

But I didn’t manage to get anything out of it!
Do you have a direction to take? I’m a bit lost!
Thank you in advance.

Leave a Reply

Your email address will not be published. Required fields are marked *