Help with setActionButton

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 () {
		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.

First, sorry for the double post. I got a message that this post was blocked by the automatic spamfiler.
I’ve sorted it out by installing a simple jQuery Modal library. (Zebra Dialog) My guess is that bootstrap modals interfere with the modals by GroceryCrud. In integrated it by inserting the zebra init in the above on click function:

onclick: function (primaryKeyValue) {
new $.Zebra_Dialog({
    type: false, 
    custom_class: "ZebraDialog_iFrame", 
    source: {
        iframe: {
			src: ""+primaryKeyValue
	title: "Filemanagement en upload voor id:"+primaryKeyValue,
	width: 800,
	height: 800     

I usually do this in a very simple manner:

$crud->setActionButton('Upload', 'fa fa-upload', function ($row) {
	return 'javascript:someJSFunction(' . $row->id . ')';
}, false);

Then, in the JS function, I am able to create jQuery dialogs etc.

Thanks for your reaction. Good to see that it can be easier.
I thought it wasn’t possible to inject javascript in setActionButton because grocery crud would block it so I didn’t try.

This is a great solution, thank you for sharing it. Could it help solve this this?

Yes, it can. I will detail how by replying on that topic.