最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
gridview全选与取值操作
时间:2022-06-25 03:10:18 编辑:袖梨 来源:一聚教程网
gridview全选与取值操作
'columns'=>array(
array(
'class'=>'CCheckBoxColumn',
//'header'=>'全选',
//'value'=>'$data->id',
//'checked'=>'true',
'htmlOptions'=>array(
'width'=>'30',
'style'=>'text-align:center',
),
),
'type'=>'POST',
'timeout'=>'30000',
'data'=>'js:{ids:jQuery("input[name='link-grid_c0[]']:checked").map(function(){ return $(this).val(); }).get()}',
'beforeSend'=>'function(){ $("#btn").hide(); $("#load").show(); }',
'success'=>'function(html){ alert(html); }',
'complete'=>'function(){ $("#btn").show(); $("#load").hide(); }',
'error'=>'function(a,b,c){ if(b=="timeout") { alert("本次执行过程超过30秒,请分批更新!"); }}',
));?>
取值
gridview 自定义value值
model里:
01 public function item($items,$name){
02 $returnValue='';
03 foreach($items as $n=>$item){
04 if(isset($this->$name)){
05 if($n==$this->$name){
06 $returnValue=$item;
07 }
08 }
09 }
10 return $returnValue;
11 }
view里:
1 array('name'=>'isPass','value'=>'$data->item(array('1'=>'是','0'=>'否'),'isProcess')','filter'=>array('1'=>'是','0'=>'否')),
更简单些
1 'value'=> '$data->ispass == "1" ? "是" : "否"',
相关文章
- 对决剑之川诸葛玲珑角色介绍一览 09-20
- 原神奈芙尔角色星级介绍 09-20
- 失控进化防护服获取攻略 09-20
- 失控进化冲锋枪汇总一览 09-20
- 逆战未来猎场传送玩法介绍一览 09-20
- 无限暖暖旧琴谱与即兴节拍协奏任务流程攻略 09-20