16 <div
class=
"design_theme_ua_regexp" id=
"grid<?= /* @escapeNotVerified */ $_htmlId ?>">
17 <div
class=
"admin__control-table-wrapper">
18 <table
class=
"admin__control-table" id=
"<?= /* @escapeNotVerified */ $block->getElement()->getId() ?>">
21 <?php
foreach (
$block->getColumns() as $columnName => $column): ?>
22 <th><?= $column[
'label'] ?></th>
24 <th
class=
"col-actions" colspan=
"<?= /* @escapeNotVerified */ $_colspan ?>"><?=
__(
'Action') ?></th>
29 <td colspan=
"<?= count($block->getColumns())+$_colspan ?>" class=
"col-actions-add">
30 <button
id=
"addToEndBtn<?= /* @escapeNotVerified */ $_htmlId ?>" class=
"action-add" title=
"<?= /* @escapeNotVerified */ __('Add') ?>" type=
"button">
31 <span><?=
$block->getAddButtonLabel() ?></span>
36 <tbody
id=
"addRow<?= /* @escapeNotVerified */ $_htmlId ?>"></tbody>
39 <input type=
"hidden" name=
"<?= /* @escapeNotVerified */ $block->getElement()->getName() ?>[__empty]" value=
"" />
45 ],
function (mageTemplate) {
50 template: mageTemplate(
51 '<tr id="<%- _id %>">' 52 <?php
foreach (
$block->getColumns() as $columnName => $column): ?>
54 +
'<?= /* @escapeNotVerified */ $block->renderCellTemplate($columnName) ?>' 58 <?php
if (
$block->isAddAfter()): ?>
59 +
'<td><button class="action-add" type="button" id="addAfterBtn<%- _id %>"><span><?= /* @escapeNotVerified */ __('Add after
') ?><\/span><\/button><\/td>' 62 +
'<td class="col-actions"><button onclick="arrayRow<?= /* @escapeNotVerified */ $_htmlId ?>.del(\'<%- _id %>\')" class="action-delete" type="button"><span><?= /* @escapeNotVerified */ __('Delete
') ?><\/span><\/button><\/td>' 66 add:
function(rowData, insertAfterId) {
72 templateValues = rowData;
76 <?php
foreach (
$block->getColumns() as $columnName => $column): ?>
77 <?= $columnName ?>:
'',
78 'option_extra_attrs': {},
80 _id:
'_' + d.getTime() +
'_' + d.getMilliseconds()
86 Element.insert($(insertAfterId), {after: this.
template(templateValues)});
88 Element.insert($(
'addRow<?= /* @escapeNotVerified */ $_htmlId ?>'), {bottom: this.
template(templateValues)});
93 var rowInputElementNames = Object.keys(rowData.column_values);
94 for (var i = 0; i < rowInputElementNames.length; i++) {
95 if ($(rowInputElementNames[i])) {
96 $(rowInputElementNames[i]).setValue(rowData.column_values[rowInputElementNames[i]]);
102 <?php
if (
$block->isAddAfter()): ?>
103 Event.observe(
'addAfterBtn' + templateValues._id,
'click',
this.add.bind(
this,
false, templateValues._id));
107 del:
function(rowId) {
113 Event.observe(
'addToEndBtn<?= /* @escapeNotVerified */ $_htmlId ?>',
'click', arrayRow<?= /* @escapeNotVerified */ $_htmlId ?>.add.bind(arrayRow<?= /* @escapeNotVerified */ $_htmlId ?>,
false,
false));
117 foreach (
$block->getArrayRows() as $_rowId => $_row) {
118 echo
"arrayRow{$_htmlId}.add(" . $_row->toJson() .
");\n";
123 <?php
if (
$block->getElement()->getDisabled()):?>
124 toggleValueElements({checked:
true}, $(
'grid<?= /* @escapeNotVerified */ $_htmlId ?>').parentNode);
$block setTitle( 'CMS Block Title') -> setIdentifier('fixture_block') ->setContent('< h1 >Fixture Block Title</h1 >< a href=" store url</a><p> Config value
foreach($block->getColumns() as $columnName=> $column) foreach($block->getColumns() as $columnName=> $column) if($block->isAddAfter()) endforeach