lg() ->title($this->title) ->body($form) // 因为此处使用了表单异步加载功能,所以一定要用 onLoad 方法 // 如果是非异步方式加载表单,则需要改成 onShow 方法 ->onShow($this->getModalScript()) ->button($this->title); } /** * 填充选择的产品ID * @return string */ protected function getModalScript() { // 弹窗显示后往隐藏的id表单中写入批量选中的行ID return <<getSelectedKeysScript()} $('#product_ids').val(key); JS; } }