Change boolean field in JModelList table like "published"

by Ivan Ankudinov   Last Updated August 13, 2019 08:10 AM

Joomla 3.9.10.

I have custom component. In admin panel I show items list from one DB table with JModelList.


class MyComModelMyCom extends JModelList {

  public function getItems() {
    return $items;


<form action="index.php?option=com_mycom&view=mycom" method="post" id="adminForm" name="adminForm">
  <table class="table table-striped">
        <th><?= JHtml::_('grid.checkall') ?></th>
        <th><?= JText::_('COM_MYCOM_TITLE') ?></th>
        <th><?= JText::_('COM_MYCOM_MYBOOLEAN') ?></th>
      <?php if (!empty($this->items)) : ?>
        <?php foreach ($this->items as $i => $item) : ?>
            <td><?= JHtml::_('', $i, $item->id) ?></td>
            <td><?= $item->title ?></td>
            <td><?= $item->myboolean ?></td>
        <?php endforeach; ?>
      <?php endif; ?>
  <input type="hidden" name="task" value=""/>
  <input type="hidden" name="boxchecked" value=""/>
  <?= JHtml::_('form.token'); ?>

There is one field with type 'boolean'. I want to change value from list table like standard field 'published'.

How can I do it? Is there any magic class in JHtml? Or what should I look for?

Related Questions

Store data to other table and get the id

Updated June 29, 2015 13:04 PM

Complex MySQL-Query

Updated April 07, 2015 18:04 PM