For running J!5.1 you must https://fabrikar.com/forums/index.php?wiki/update-from-github/ or include the new file manually https://fabrikar.com/forums/index.php?threads/joomla-5-1-and-fabrik-cannot-find-files-error.54473/post-285151 See also Announcements
Please see our announcement here.
requirejs(['fab/fabrik'], function () {
var detailsUrl = window.location.href.toString();
var formUrl = detailsUrl.replace("details", "form");
jQuery('div.btn-group').append('<button type="button" class="btn button" onclick="window.location=''+formUrl+''" name="EditButton">Edit</button>');
});
That is what I use in the default protostar template. Are you using the protostar bootstrap template?Thanks, but I just tried this technique on two of my lists and it didn't work for either one. Any ideas why not?
$form = $this->form;
$model = $this->getModel();
$formId = $model->getId();
$rowId = $model->getRowId();
$view = 'form';
$url = JRoute::_('index.php?option=com_' . $this->package . '&view=' . $view . '&formid=' . $formId . '&rowid=' . $rowId);
<button type="button" class="btn button" onclick="location.href='<?php echo $url ?>'" name="Edit">Edit</button>
$model = $this->getModel();
$formId = $model->getId();
$rowId = $model->getRowId();
$view = 'form';
$url = JRoute::_('index.php?option=com_' . $this->package . '&view=' . $view . '&formid=' . $formId . '&rowid=' . $rowId);
echo '<a class="fabrik-edit btn button" href=' . $url . '" name="Edit"><i data-isicon="true" class="icon-edit "></i>Edit</a> ';