There are cases where you want to show a list of records and let users select rows to process them for some reason. This option requires two things: how to make records selectable and how to add custom buttons to the grid. A sample of such a form shown below. 



  • Make the form selectable. 

To make the rows selectable, you only need to set the property ‘click to select’ to true. In this case you can select a number of records. In case you only want to allow to select exact one record then set the property ‘single select’ to true.


  • Apply custom buttons. 


  • To process the selected records you need to have a function to trigger the processing. In PHspeed you can define userbuttons in the grid. That way you can assign different funtions that will be performed on the selected records.


In this sample two buttons are added, one to set a payment status for the selected recors, and one to reset this status. 





The form now looks as follows:        


The thing to do now is to apply the onOrocessRows event. (There is also a onEndProcessRows when all records have been processed).



For each selected row, the function onProcessRow is executed. The system passes the data of the physical row and the butonid. Depending on the buttonId you can specify certain actions:




The function MUST return true or false. If set to false the processing of the records will abort. So you can use it in case of errors:


In the code P or R you need to set this status if you encounter an error. 




At the end of the process the onEndProcess is called. It can be used to inform the user that processing has finished: