YiiFramework development tutorial Zii component-Selectable example

Source: Internet
Author: User
CJuiSelectable can display a list. each item in the list supports Select events. it encapsulates the JUISelectable plug-in. its basic usage is as follows: [php] & lt ;? PhpYii: app ()-& gt; clientScript-& gt; registerCss (& amp; #39; selectable & amp; #39;, & q CJuiSelectable can display a list, each item in the List supports the Select event, which encapsulates the JUI Selectable plug-in. its basic usage is as follows: [php] ClientScript-> registerCss ('selectable', "# selectable {list-style-type: none; margin: 0; padding: 0; width: 60%;} # selectable li {margin: 2px; padding: 4px; border: 1px solid # e3e3e3; background: # f7f7f7} # selectable. ui-selecting {border: 1px solid # fad42e;} # selectable. ui-selected {border: 1px solid # fad42e; background: # fcefa1;} # select-result {margin: 0 0 10px 2px;} ", 'screen', CClientScri Pt: POS_HEAD);?> None Widget ('zii. widgets. jui. CJuiSelectable, array ('id' => 'selectable', 'items '=> array ('id1' => 'item 1 ', 'id2' => 'item 2', 'id3 '=> 'item 3'), 'options' => array ('stop' => 'JS: function (event, ui) {var result = $ ("# select-result "). emptyempty (); $ (". ui-selected ", this ). each (function () {var index = $ ("# selectable li "). index (this); result. append ("#" + (index + 1) ;};}');?> ClientScript-> registerCss ('selectable', "# selectable {list-style-type: none; margin: 0; padding: 0; width: 60%;} # selectable li {margin: 2px; padding: 4px; border: 1px solid # e3e3e3; background: # f7f7f7} # selectable. ui-selecting {border: 1px solid # fad42e;} # selectable. ui-selected {border: 1px solid # fad42e; background: # fcefa1;} # select-result {margin: 0 0 10px 2px;} ", 'screen', CClientScript: PO S_HEAD);?> Www.2cto.com None Widget ('zii. widgets. jui. CJuiSelectable, array ('id' => 'selectable', 'items '=> array ('id1' => 'item 1 ', 'id2' => 'item 2', 'id3 '=> 'item 3'), 'options' => array ('stop' => 'JS: function (event, ui) {var result = $ ("# select-result "). empty (); $ (". ui-selected ", this ). each (function () {var index = $ ("# selectable li "). index (this); result. append ("#" + (index + 1) ;};}');?> Use Javascipts to respond to selected events.

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.