Don't show ajax button in list operation #1163
-
Hi, help me please. I try add ajax button follow the documentation here, but it doesn't show. Here my code in CRUD ` protected function setupListOperation()
php artisan backpack:version: PHP EXTENSIONS:Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, gettext, gmp, json, iconv, SPL, intl, session, mbstring, standard, mysqlnd, pcntl, exif, mysqli, PDO, PDO_Firebird, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, random, readline, Reflection, imap, shmop, SimpleXML, snmp, soap, sockets, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, igbinary, trader, redis, pdo_sqlsrv, dbase, protobuf, msgpack, pdo_dblib, phalcon, xhprof, mongodb, grpc, mailparse, sqlsrv, yaml, imagick, timezonedb, ldap, ssh2, xlswriter, memcached, sodium, memcache, mcrypt, ds LARAVEL VERSION:10.48.17.0 BACKPACK PACKAGE VERSIONS:backpack/basset: 1.3.5 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hey @amigolj Sorry for the inconvenience. Docs need a minor fix there. It is missing an CRUD::button('type')->stack('line')->view('crud::buttons.quick')->meta(
[
+ 'access' => true, // or 'access' => 'operation_name', ex: list, update
'label' => 'Email',
'icon' => 'la la-envelope',
'wrapper' => [
'href' => function ($entry, $crud) {
return backpack_url("invoice/email");
},
'ajax' => true, // <- just add `ajax` and it's ready to make ajax request
]
]
); |
Beta Was this translation helpful? Give feedback.
-
@karandatwani92 I don't know but now after press button, I got error 404. I need to add maybe some route? |
Beta Was this translation helpful? Give feedback.
Hey @amigolj
Sorry for the inconvenience. Docs need a minor fix there. It is missing an
access
attribute, which tells if the user has permission to access it or not.CRUD::button('type')->stack('line')->view('crud::buttons.quick')->meta( [ + 'access' => true, // or 'access' => 'operation_name', ex: list, update 'label' => 'Email', 'icon' => 'la la-envelope', 'wrapper' => [ 'href' => function ($entry, $crud) { return backpack_url("invoice/email"); }, 'ajax' => true, // <- just add `ajax` and it's ready to make ajax request ] ] );