YiiCGridView custom bottons method

Source: Internet
Author: User
YiiCGridView custom bottons method

Sample code

?
12345678910111213 Array ('class' => 'cbuttoncolumn', 'template' => '{email} {view} {update} {delete }', 'buttons' => array ('email '=> array ('label' => 'email', 'imageurl' => Yii: app () -> request-> baseUrl. '/images/icon_sina.gif', 'URL' => 'yii: app ()-> createUrl ("users/email ", array ("id" => $ data-> id ))',),),),

Here is an example made by myself.


?
1234567891011121314151617181920212223242526272829303132333435 Widget ('zii. widgets. grid. CGridView ', array ('dataprovider' => $ model-> search (), 'column' => array ('selectablerdones' => 2, 'footer' =>'Batch delete', 'Class' => 'ccheckboxcolumn', 'headerhtmloptions' => array ('width' => '33px '), 'checkboxhtmloptions '=> array ('name' => 'selectdelete []'),), 'Company' => array ('name' => 'Company ', 'value' => '$ data-> company', 'footer '=>'Batch recommendation',), // Display the 'title' attribute 'model' => array ('name' => 'model ', 'value' => '$ data-> model', 'footer' =>'Cancel recommendation',), 'Top' => array ('name' => 'top', 'value' =>' $ data-> tops '), 'Category ', 'brand', 'Money', 'number', 'status' => array ('name' => 'status ', 'value' => '$ data-> getstatus'), array (// display a column with "view ", "update" and "delete" buttons 'class' => 'cbuttoncolumn',);?>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.