atk4 / mastercrud

Manipulates ATK CRUD through the force of references
https://atk4.org
MIT License
9 stars 7 forks source link

columnActions add some jsExpression to it ? #19

Open rapgithub opened 6 years ago

rapgithub commented 6 years ago

is it possible to create columnActions in conjunction with jsExpression in my case I need a new icon per row that when clicked goes to another page and send the data id reference of the row as a parameter...

I tried to use this in my model and does not work, it gives me error all the time...

'columnActions'=>[
    'Link'=>['icon'=>'database'],
            new \atk4\ui\jsExpression('document.location = go.php?q=1', [$crud->jsRow()->data('id')])        ],

I tried to add it like this and shows the icon well but when click it opens a modal popup and spinning loader in the middle and stop there... it does not execute the Alert as JS...

$m = $crud->setModel(new Users($app->db),
[
    'columnActions'=>[
        'Action'=>['jsExpression'=>new \atk4\ui\jsExpression('alert([])', ['The wait is over']),'icon'=>'database']

       ],
...

any ideas? thanks