Hello I really have a problem with setActionButton. Is it possible to return a (local) url and have it displayed on the (or another) popup?
I have this code:
$crud->setActionButton('Upload', 'fa fa-upload', function ($row) {
return '/file-upload/' . $row->id;
}, false);
but I want to have ‘/fileupload’.$row->id on a popup. I also tried to use a custom gc-load.js file, and tried to do a Ajax call from there like this:
$(document).ready(function () {
$('.gc-container').groceryCrud({
openInModal: true,
hashEvents: false,
actionButtons: [{
iconCssClass: 'fa fa-upload',
label: 'Upload',
onClick: function (primaryKeyValue) {
/* This doen't work, I tried to load a Modal wrapper, but it conflicts with
Grocerycrud's own popup
var m = BootstrapModalWrapperFactory.createAjaxModal({
message: '<div class="text-center">Loading</div>',
closable: true,
title: "Data upload",
closeByBackdrop: true,
sendId: true, // default is true which send the modal id as a url parameter.
size: "modal-sm",
ajax: {
url: '/file-upload/'//+primaryKeyValue
}
});*/
}
}],
});
});
I am completelely stuck here can anyone please have some help.