DataAction object
-
get_value method - returns value of named field ( name of column or alias):
$action->get_value($name)
The only parameter you should specify is the name of column or alias.
-
set_value method - sets values of named field:
$action->set_value($name,$value)
The parameters are the following:
-
$name - name or alias of the field
-
$value - value of the field in question
-
get_userdata_value method returns extra data received from client side, related to updated element:
$action->get_userdata_value($name,$value)
The parameters are the following:
-
$name - name or alias of the field
-
$value - value of the field in question
-
set_userdata_value method allows to set user defined data for selected field:
$action->set_userdata_value($name,$value)
The parameters are the following:
-
$name - name or alias of the field
-
$value - value of the field in question
-
get_status method returns action type of the item:
$action->get_status()
-
set_status method allows to set the status of operation - do not use it if you need to avoid using custom status:
$action->set_status($value)
The parameter of this method is :
-
$value- status of operation
-
get_id method returns id of current record:
$action- >get_id()
-
get_data method returns hash of values:
$action->get_data()
-
set_response_text method:
$action->set_response_text($text);
The only parameter you should specify is:
-
$text - any text value , which will be returned on client side with related action structure
-
set_response_xml method allows to set xml-string , which will be included in response ( if you need to provide just a text - use the method mentioned above ):
$action->set_response_xml($text)
The only parameter you should specify is:
-
$text - any text value , which will be returned on client side with related action structure
-
set_response_attribute method marks operation as incorrect and cancels default update:
operation$action->set_response_attribute($name,$value)$action->error();
-
invalid method marks provided data as invalid and cancels default update operation:
$action->invalid();
Note: set_response_xml, set_response_attribute, invalid methods can be used to transfer additional info for client side code, they are necessary only if you want to add some heavy customization to update process
-
success method confirms that operation has been executed correctly and cancels default update operation:
$action->success();
-
success($id) method has almost the same functionality as the previous one, but forces ID update on client side (insert operation):
$action->success($id);
-
add_field method allows to register field for usage during update|insert|delete operation:
$action->add_field($name,$value);
The parameters are the following:
-
$name - name or alias of the field
-
$value - value of the field in question
-
remove_field method allows to remove one of default fields from db operation:
$action->remove_field($name,$value)
The parameters are the following:
-
$name - name or alias of the field
-
$value - value of the field in question
-
get_new_id method returns ID, received after insert operation ( valid for afterProcessing event only )
$action->get_new_id();
Shared for GridDataItem, TreeDataItem, ComboDataItem, TreeGridDataItem
-
get_value method returns value for selected item:
$dataItem->get_value($name)
The only parameter you should specify is:
-
$name - name or alias of the item
-
set_value method allows to set value of selected item:
$dataItem->set_value($name,$value)
-
$name - name or alias of the item
-
$value - value of the item in question
-
get_id method returns id of the item:
$dataItem->get_id();
-
set_id method allows to set id of the item:
$dataItem->set_id($value);
The only parameter you should specify is:
-
get_index method returns index of current item ( for example, in grid , it will be an index of row:
$dataItem->get_index();
-
calling skip method will result in ignoring current item while rendering output. It allows to define custom filtering rules:
$dataItem->skip();
GridDataItem/TreeGridDataItem specific
-
set_row_color method allows to set color for any row in the component:
$dataItem->set_row_color($color)
The only parameter you should specify is:
-
$color - the color of the row
-
set_row_style method allows to set the style for any row
$dataItem->set_row_style($style )
The only parameter you should specify is:
-
$style - style of the row in question
-
set_cell_style method allows to set style for any cell of the item:
$dataItem->set_cell_style($name,$value)
-
$name - name or alias of the cell
-
$value - style of the cell in question
-
set_cell_class method allows to set class for any cell of the item:
$dataItem->set_cell_class($name,$value)
-
$name - name or alias of the cell
-
$value - class of the cell in question
-
set_row_attribute method allows to set attributes for any row of the component:
$dataItem->set_row_attribute($attr,$value)
The parameters are the following:
-
$attr - name of attribute
-
$value - value of attribute
-
set_cell_attribute method allows to set attributes for any cell of the item:
$dataItem->set_cell_attribute($name,$attr,$value)
The parameters of this method are the following:
-
$name - name of alias of the cell in question
-
$attr - name of attribute
-
$value - value of attribute
TreeGridDataItem
-
get_parent_id method returns parent id of selected item:
$dataItem->get_parent_id();
-
get_check_state method returns the state of selected item:
$dataItem->get_check_state();
The only parameter you should specify is:
-
$value -returns state of checkbox related to the item:
-
set_check_state method allows to set state of checkbox related to the item:
$dataItem->set_check_state($value);
The only parameter you should specify is:
-
$value - state of the item, valid valus are "0" - unchecked, "1" - checked, "-1" - third state
-
set_image method allows to set image for all check states of the node in tree:
$dataItem->set_image($img);
The parameter is:
-
$img - image which will be set for the item, path relative to icon's path of tree
-
The method below allows two options to set different images for each check state of item:
$dataItem->set_image($img_folder_closed,$img_folder_open,$img_leaf);
The parameters you should specify are:
-
$img_folder_closed - image which will be set for the node with closed state
-
$img_folder_open - image which will be set for the node with open state
-
$img_leaf - image which will be set for the node without subitems
TreeDataItem
-
get_parent_id method returns parent id of the selected item:
$dataItem->get_parent_id();
-
set_image method allows to set image for any item in tree:
$dataItem->set_image($img)
You should specify the following parameter:
-
$img - image which will be set for selected item
ComboDataItem