asp.net gridview custom code for value values

  • 2020-05-12 02:31:08
  • OfStack

model:
 
public function item($items,$name){ 
$returnValue=''; 
foreach($items as $n=>$item){ 
if(isset($this->$name)){ 
if($n==$this->$name){ 
$returnValue=$item; 
} 
} 
} 
return $returnValue; 
} 

view:
 
array('name'=>'isPass','value'=>'$data->item(array(\'1\'=>\' is \',\'0\'=>\' no \'),\'isProcess\')','filter'=>array('1'=>' is ','0'=>' no ')), 

To be more simple
 
'value'=> '$data->ispass == "1" ? " is " : " no "', 

Related articles: