0
点赞
收藏
分享

微信扫一扫

yii2执行JS 隐藏指定搜索框

八卦城的酒 2023-01-16 阅读 56


yii2中如何执行JS代码?如何隐藏指定列的搜索框?

答案:

<?php $this->beginBlock('MyJS')?>
// 隐藏指定搜索框
$("input[name='UserSearchModel[userPass]']").hide();
$("input[name='UserSearchModel[createTime]']").hide();
$("input[name='UserSearchModel[expireTime]']").hide();

<?php $this->endBlock()?>
<?php $this->registerJs($this->blocks['MyJS'],\yii\web\View::POS_END);?>

效果图:

yii2执行JS 隐藏指定搜索框_ide

举报

相关推荐

0 条评论