bug:使用actionScript,handle无法获取选中项目
public function handle(Request $request)
{
$keys = $this->getKey(); // 有了actionScript,这个就无法获取了
var_dump($keys);
//$this->getSelectedKeysScript();
return $this->response()
->success('成功: '.implode(',',$keys));
}
protected function actionScript()
{
$warning = __('No data selected!');
return <<<JS
function (data, target, action) {
var key = {$this->getSelectedKeysScript()}
if (key.length === 0) {
Dcat.warning('{$warning}');
return ;
}
Object.assign(data, {_key:key});
console.log(key.join('/'));
}
JS;
}
推荐文章: