Troubleshooting Yii Cgridview in advanced search options when paging after PHP crashes _php tutorial

Source: Internet
Author: User
Backward PHP crashes because there are too many options, and the empty option is not added to the paging URL. The following code can be placed at the bottom of the views/layouts/main.php file to fix the address of the Cgridview page link. [HTML] Clientscript->registerscript (' Pagerhref ', "$ (function () {$ ('. Pager a ')." Each (function () {var href = $ (this). attr (' href '); var page = Href.match (/\/([\w]+) _page\/([0-9]+)/); if (page! = null) {page = page[1]+ ' _page= ' +page[2];} else {page = ';} var sort = Href.match (/\/([\w]+) _sort\/([\w]+)/ ); if (sort! = null) {sort = sort[1]+ ' _sort= ' +sort[2];} else {sort = ';} var fields = $ ('. Search-form form '). Serializear Ray (); var data = '; $.each (fields, function (i, field) {if (Field.value! = ") {if (data = =") {data + = Field.name + ' = ' + Field.value;} el SE {data + = ' & ' + field.name + ' = ' + Field.value;}} }); if (Data! = "&& page! =") {page = ' & ' + page;} if (Data! = ' | | page! = ') && sort! = ') {s ORT = ' & ' + sort; } var url = ' ". $this->createurl ($this->id. ' /'. $this->action->id). '? ' + encodeuri (data) + page + sort; $ (this). attr (' href ', url); }); }); ");?>

http://www.bkjia.com/PHPjc/477635.html www.bkjia.com true http://www.bkjia.com/PHPjc/477635.html techarticle backward PHP crashes because there are too many options, and the empty option is not added to the paging URL. The following code can be placed at the bottom of the views/layouts/main.php file, fixed cgridvie ...

  • 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.