HOW TO pass my own parameters with multi-row operations?

Talk and info about common issues

Moderators: ne_moj, zewa, vadimako, ne_moj, zewa, vadimako

administrator
Site Admin
Site Admin
Posts: 5992
Joined: Jan 7th, '09, 23:18
Contact:

HOW TO pass my own parameters with multi-row operations?

Postby administrator » Mar 9th, '12, 11:57

DataGrid allows you to create and use your own multi-row operations.

Here the example:

Code: Select all

$multirow_option = true;
$dgrid->AllowMultirowOperations($multirow_option);
$multirow_operations = array(
   ...
   'my_operation_name' => array(
          'view'=>true,
          'flag_name'=>'my_flag_name',
          'flag_value'=>'my_flag_value',
          'tooltip'=>'Do something with selected',
          'image'=>'image.gif'
   )
);
$dgrid->SetMultirowOperations($multirow_operations); 


If you want to add for 'flag_value' your own dynamically created data, you may use a following trick:

Code: Select all

'flag_value'=>'\' + yourJSFunction() + \'',

or

Code: Select all

'flag_value'=>'my_static_value&param2=\' + yourJSFunction() + \'',


where yourJSFunction() is a JavaScript function, that returns some value, according to your needs.
For example:

Code: Select all

<script>
function yourJSFunction(){           
      if(document.getElementById('rtystatus').value == 1){
           return '1';
      }else{
           return '0';
      }               
}
</script>

Return to “ApPHP DataGrid {HOW TO}”