Home  >  Article  >  Backend Development  >  Yii-视图- CListView操作扩展用法(zyd)_PHP教程

Yii-视图- CListView操作扩展用法(zyd)_PHP教程

WBOY
WBOYOriginal
2016-07-14 10:09:08707browse

视图文件

[html]  
$add_drop = CHtml::dropDownList('catlist','',CmpCat::model()->getCmpCat('移动到分类'),array('class'=>'s_ipt w_120 removedropcatbatch'));  
$remove_drop = CHtml::dropDownList('catlist','',CmpCat::model()->getCmpCat('添加到分类'),array('class'=>'s_ipt w_120 adddropcatbatch'))  
?>  
$this->widget('zii.widgets.CListView', array(  
    'dataProvider'=>$model->search(),  
    'itemView'=>'product_saleing_view',    
    'emptyText'=>'暂时没有数据',  
    'selectAll'=>array('ids[]','id[]'),  
    'artLink'=>array(  
        //首页推荐  
        array(Yii::t('cmp','Recommended home'),'/company/product/recommend','确认推荐选中产品到首页!'),  
        //取消推荐  
        array(Yii::t('cmp','un Recommended home'),'/company/product/uncommend','确认取消推荐选中产品!'),  
        //下架  
        array(Yii::t('cmp','downshelf'),'/company/product/downshelf','确认上架选中产品!'),  
    ),  
    'batchItem'=>array(  
        //移动到分类  
        $add_drop,  
        //添加到分类  
        $remove_drop,  
    ),  
    ));  
?>  
 
jq代码
[html]  
//添加到分类  
$('.adddropcatbatch').bind('change',function(){  
    var pid = $(".chkitem:checked").serialize() ;  
    var catid = $(this).val();  
    location.href='/company/cmpcat/addcmpcat?catid='+catid+'&'+pid;  
})  
  
//移动到分类  
$('.removedropcatbatch').bind('change',function(){  
    var pid = $(".chkitem:checked").serialize() ;  
    var catid = $(this).val();  
    location.href='/company/cmpcat/removecmpcat?catid='+catid+'&'+pid;  
})  
 
 
全选反选
[html]  
'chk f_l chkitem','onclick'=>'CheckList("ids[]","id[]")','value'=>$data->zp_id))?>  
 
效果图
1.Yii-视图- CListView操作扩展用法(zyd)_PHP教程
 
2.Yii-视图- CListView操作扩展用法(zyd)_PHP教程

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/477707.htmlTechArticle视图文件 [html] ?php $add_drop = CHtml::dropDownList(catlist,,CmpCat::model()-getCmpCat(移动到分类),array(class=s_ipt w_120 removedropcatbatch)); $remove_drop = CHtml::drop...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn