MODX MySQL Ajax Table Editor

In order not to forget important moments in the configuration, I will write.

function initiateEditor()
{
$tableColumns['id'] = array('display_text' => '№', 'perms' => 'TVQSXOM', 'col_header_info' => 'width="*"');
$tableColumns['date'] = array('display_text' => 'Дата', 'perms' => 'EVCTAXQSHO', 'col_header_info' => 'width="*"');
$tableColumns['name'] = array('display_text' => 'Имя посетителя', 'perms' => 'EVCTAXQSHO', 'col_header_info' => 'width="*"');
$tableColumns['phone'] = array('display_text' => 'Врач', 'perms' => 'EVCTAXQSHO', 'col_header_info' => 'width="*"');
$tableColumns['content'] = array('display_text' => 'Комментарий', 'perms' => 'EVCTAXQSHO',
'textarea' => array('rows' => 5, 'cols' => 30), 'col_header_info' => 'width="50%" style="border: 1px solid #333;"');
// Статусы
$statusArr = array(
'open' => 'Новая',
'closed' => 'Обработана',
'pending' => 'Отказано'
);
// Редактируемое поле
$tableColumns['options'] = array(
'display_text' => 'Статус',
'perms' => 'EVCTAXQS',
'select_array' => $statusArr,
'default' => 'Новая'
);
 
$tableName = 'modx_sinonim';//'modx_site_content'  employees
$primaryCol = 'id';
$errorFun = array(&$this,'logError');
$permissions = 'EAVIDQCSXHOM'; // удаление пачками
 
$this->Editor = new AjaxTableEditor($tableName,$primaryCol,$errorFun,$permissions,$tableColumns);
$this->Editor->setConfig('tableInfo','cellpadding="1" width="100%"');
$this->Editor->setConfig('orderByColumn','id');
$this->Editor->setConfig('ascOrDesc','desc'); //порядок сортировки
$this->Editor->setConfig('addRowTitle','Add Employee');
$this->Editor->setConfig('editRowTitle','Edit Employee');
}

I don’t know why the rules are mutually excluded. if(stristr($this->permissions,'D') && !stristr($this->permissions,'I'))

But if you want to add multi-delete strings, then in the file.

assets/modules/modx_mate/php/AjaxTableEditor.php line 1655 rewrite

if(stristr($this->permissions,'D') && stristr($this->permissions,'I'))


Let’s discuss your project

Tell me what you would like to build. I will reply by email.

Or message me on Telegram @ifwcom