php - How to pass csrf token in laravel 5.4 version for jqgrid? -


trying pass csrf token ace admin jqgrid template.

jquery(grid_selector).jqgrid({                     data: grid_data,           datatype: "local",           height: 250,           colnames:[' ', 'id', 'name', 'email'],           colmodel:[             {name:'myac', index:'', width:80, fixed:true, sortable:false,               resize:false,               formatter:'actions',                formatoptions:{                  keys:true,                                 deloptions:{recreateform: true, beforeshowform:beforedeletecallback},                 editformbutton:true,                  editoptions:{recreateform: true, beforeshowform:beforeeditcallback, beforesubmitcell: beforesubmitcell}               }             },             {name:'id',index:'id', width:60, sorttype:"int", editable: true},             {name:'name',index:'name', width:150,editable: true, editoptions:{size:"30",maxlength:"50"}},             {name:'email',index:'email', width:150,editable: true, editoptions:{size:"30",maxlength:"50"}}           ],            viewrecords : true,           rownum:10,           rowlist:[10,20,30],           pager : pager_selector,           altrows: true,                     //toppager: true,           multiselect: true,           //multikey: "ctrlkey",           multiboxonly: true,                     loadcomplete : function() {             var table = this;             settimeout(function(){               stylecheckbox(table);               updateactionicons(table);               updatepagericons(table);               enabletooltips(table);             }, 0);           },                 editurl: "{{ route('admincrud', ['menu' => 'users', 'oper' => 'edit']) }}",           caption: "users listings"               });    function beforesubmitcell(rowid,celname,value,irow,icol) {       alert('rowid => ', rowid);       return {token:'test'}     } 

its not entering beforesubmitcell, should done. how , csrf token should passed crud operations?

add csrf_token postdata , editdata options. below.

jquery(grid_selector).jqgrid({                 postdata: { "_token": {{ csrf_token() }} },       editdata: { "_token": {{ csrf_token() }} },       ....       .... 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -