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 隐藏指定搜索框

相关文章:

  • 2021-09-09
  • 2022-01-13
  • 2021-05-31
  • 2021-11-21
  • 2022-12-23
  • 2021-07-19
  • 2021-11-25
  • 2021-10-03
猜你喜欢
  • 2021-09-25
  • 2021-07-01
  • 2021-12-23
  • 2021-06-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案