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