Skip to content

Commit

Permalink
(Fixes issue 1782)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiang.xue committed Mar 14, 2011
1 parent c8ccfae commit b1a68be
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -32,6 +32,7 @@ Version 1.1.7 to be released
- Enh #558, #1755: Added parametrized named scopes, added scopes to criteria, implemented scope criteria merging (creocoder, Sam Dark)
- Enh #801: Added RESTful URL management (Qiang)
- Enh #1117: Added support for "through" in Active Record relations allowing to handle association table data (creocoder, Sam Dark)
- Enh #1782: Added updateSelector property to both CGridView and CListView (Qiang)
- Enh #1786: Enhanced CUrlValidator by adding 'validSchemes' and 'defaultScheme' property (Y!!)
- Enh #1792: Enhanced CGridView: on ajax error a proper message is composed and displayed or optionally sent to the custom error handler (mdomba)
- Enh #1795: Added CFormInputElement::$enableAjaxValidation to allow turning on/off AJAX validation for individual input fields (Qiang)
Expand Down
8 changes: 8 additions & 0 deletions framework/zii/widgets/CListView.php
Expand Up @@ -118,6 +118,12 @@ class CListView extends CBaseListView
* containers' content in AJAX fashion, these container IDs may be listed here (separated with comma).
*/
public $ajaxUpdate;
/**
* @var string the jQuery selector of the HTML elements that may trigger AJAX updates when they are clicked.
* If not set, the pagination links and the sorting links will trigger AJAX updates.
* @since 1.1.7
*/
public $updateSelector;
/**
* @var string the name of the GET variable that indicates the request is an AJAX request triggered
* by this widget. Defaults to 'ajax'. This is effective only when {@link ajaxUpdate} is not false.
Expand Down Expand Up @@ -192,6 +198,8 @@ public function registerClientScript()
'loadingClass'=>$this->loadingCssClass,
'sorterClass'=>$this->sorterCssClass,
);
if($this->updateSelector!==null)
$options['updateSelector']=$this->updateSelector;
if($this->beforeAjaxUpdate!==null)
$options['beforeAjaxUpdate']=(strpos($this->beforeAjaxUpdate,'js:')!==0 ? 'js:' : '').$this->beforeAjaxUpdate;
if($this->afterAjaxUpdate!==null)
Expand Down
8 changes: 8 additions & 0 deletions framework/zii/widgets/grid/CGridView.php
Expand Up @@ -127,6 +127,12 @@ class CGridView extends CBaseListView
* containers' content in AJAX fashion, these container IDs may be listed here (separated with comma).
*/
public $ajaxUpdate;
/**
* @var string the jQuery selector of the HTML elements that may trigger AJAX updates when they are clicked.
* If not set, the pagination links and the sorting links will trigger AJAX updates.
* @since 1.1.7
*/
public $updateSelector;
/**
* @var string a javascript function that will be invoked if an AJAX update error occurs.
*
Expand Down Expand Up @@ -347,6 +353,8 @@ public function registerClientScript()
'tableClass'=>$this->itemsCssClass,
'selectableRows'=>$this->selectableRows,
);
if($this->updateSelector!==null)
$options['updateSelector']=$this->updateSelector;
if($this->enablePagination)
$options['pageVar']=$this->dataProvider->getPagination()->pageVar;
if($this->beforeAjaxUpdate!==null)
Expand Down

0 comments on commit b1a68be

Please sign in to comment.