add parameters in qdatagrid action

Login or register to post comments
2 replies [Last post]
Offline
Joined: 02/04/2011

Hi, I'm trying to add a parameter when I click into a qdatagrid.

I do this:

[in Form_Create()]
...
$this->datagrid->AddAction(new qclickevent(),new qajaxaction('nameAction');
$this->datagrid->ActionParameter=44;
...

[in nameAction($strFormId,$strControlId,$strParameter)]
...
qapplication::displayAlert($strParameter);
...

When I run it, I can't see the parameter with value 44, it shows 1,why??how can I do to add a exact parameter in the actions??

thanks!

Offline
Joined: 08/12/2009

try this:

$this->datagrid->RowActionParameterHtml = '<?= $_ITEM->Id ?>';
$this->AddRowAction(
  new QClickEvent(),
  new QServerAction('dtgRow_Click')
);

...

public function dtgRow_Click($strFormId, $strControlId, $strParameter) {

}

Offline
Joined: 02/04/2011

yes, I did it too. The problem is that I need manage the checkboxs from header in the qdatagrid. I have 'AddRowAction' when I click into a row and I want custom the 'AddAction' in qdatagrid to do something when I click in these checkbox.