CRUD buttons not triggering any action or modal windows

Hello community,
I had a bit of troubles using CRUD in a view in order to use it functionality.
Currently it behaves only as a Grid, and upon clickin on the buttons it doesn’t trigger any action (neither a modal windows(form), nor any error in the browser console that I can followup with).
I notice that there were no event listeners on the generated html template, which I believe maybe the issue, though in the documentation listed here: It should work out of the box.
My configuration is as follow:


require_once __DIR__.'/vendor/autoload.php';

$app = new App();



class Model_User extends \Model {
	public $table = 'users';
	public function init(){


class page_admin extends \Page {
	public function init(){
		$crud = $this->add('CRUD');

Before posting here I checked in stack overflow, where there is a reference on the documentation,gitter, github issues, here (forum), and an extensive check on multiple repos with test projects on github, though most of them I was unable to run.
For my configuration as a server-side:

  • PHP 7.1
  • Nginx
  • atk4 version 4.4 (4.3.3 framework version)
  • Firefox 54.0.0
  • Chromium 60.0.3112.90

Greatly appreciated beforehand.

P.S. I use atk4 as a package with composer autoload.


So it appears that the JavaScript does not initialize properly - buttons are not interactive.

Try a simpler example:

$b = $page->add('Button');

to confirm if it works. Also find out which files it includes and look at the contents of those files, perhaps you have a blank .JS somewhere. Sounds like the problem is server-related.

Try running “php -S localhost:8888” locally and open your application like that.

1 Like


  • can you show us your composer.json file (which atk4 repo branch you include)
  • see what JavaScript errors it shows in browser console by pressing F12
1 Like

@romaninsh - Thanks for the feedback - I just tried to add a button as referenced and yes, no JavaScript interaction whatsoever, nor event loaded which in fact points towards incorrect JavaScript loading.
The files being loaded are the following:
– EDIT –
trying on a local server with php -S Issue persists.

on the server side I use the following configuration this is Nginx:

server {
    listen       80;
    root   /usr/share/nginx/html/agile;
    index  index.html index.htm index.php;
    location / {
         try_files $uri $uri/ /index.php?$query_string;

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;

    location ~ \.php$ {
    fastcgi_index  index.php;
    try_files $uri $uri/ /index.php =404;
        fastcgi_split_path_info ^(.+\.php)(.*)$;
        fastcgi_pass  unix:/run/php-fpm/php-fpm.sock;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include  /etc/nginx/fastcgi_params;
    include /etc/nginx/fastcgi.conf;

@imants - Sure - here is the composer.json file:

	"require": {

P.S. - no JavaScript errors are displayed.
Thanks for the cooperation and assistance,

Found the issue, it was due to the main (App) class namespacing, which made the buttons appear under the namespace id and jquery was unable to select those elements.

Is there a way to edit this behaviour?


Look into View::getJSID() (or abstractview, memory fails me) function or alternatively at the AbstractObject::add() which are the ones assigning names to the object “name” from class. I think namespace should be ignored for this purposes, but I suspect that “get_class” does include it anyway.