tel8618217223380 / prado3

Automatically exported from code.google.com/p/prado3
Other
0 stars 0 forks source link

Can't disable AutPostBack in TCheckBoxColumn #373

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create page with TActiveDataDataGrid component
2. Add TActiveEditCommandColumn and TActiveCheckBoxColumn columns to datagrid
3. Associate OnEditCommand with datagrid
4. Click edit command
5. Click checkbox

What is the expected output? 
Nothing.

What do you see instead?
Autopostback from checkbox

What version of the product are you using? On what operating system?
3.1.10

Please provide any additional information below.

I can't figure out how to disable autopostback from TActiveCheckBoxColumn 
without change prado's core code.

It may should be disabled by default in TActiveCheckBoxColumn class 
(Web/UI/ActiveControls/TActiveDataGrid.php) on line 522 by 
$checkBox->setAutoPostBack(false); or it should be possible to give the 
parameter to disabling it.

Original issue reported on code.google.com by sampsa.s...@inoob.com on 16 Nov 2011 at 1:04

GoogleCodeExporter commented 9 years ago
Ok, I discovered workaround for this.

In OnEditCommand callback you can do it this way:

public function myOnEditCommand($sender,$param) {
  $this->activeDataGrid->EditItemIndex = $param->Item->ItemIndex;
  //.. something here      
  $this->activeDataGrid->Items[$this->activeDataGrid->EditItemIndex]->myTActiveCheckBoxColumn->CheckBox->setAutoPostBack(false);    
}

Original comment by sampsa.s...@inoob.com on 16 Nov 2011 at 1:21

GoogleCodeExporter commented 9 years ago
Alternatively, you can do it in the OnItemCreated event. This is documented in 
the Sample3 of TActiveDataGrid

Original comment by ctrlal...@gmail.com on 16 Nov 2011 at 2:34