yii2执行JS 隐藏指定搜索框

阅读 56

2023-01-16


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)

0 0 举报