Select theme:
This guide demonstrates how to handle page and component events in Radzen Angular applications.
Events represent things that have taken place - for example an application page is loaded, the user clicks a button or selects a dropdown item.
Pages have one event - the Load event. Page events are visible in the Radzen property grid every time the developer opens a page in design-time. One can bring them back later by clicking in an empty page area or via the component picker above the property grid.
Component events appear in the Radzen property grid when you:
Actions execute unconditionally by default. To change that you can set the Condition property.
The action will execute only if the condition expression evaluates to true
.
To handle events in Radzen you should add one or more actions. Click the edit icon next to the name of the event. This opens the Edit handler dialog which allows you can add, remove and update actions.
Actions execute in the order they are specified. You can change the order of execution by moving the actions up or down via the "^" and "v" buttons.
Radzen Angular applications support the following action types:
When you create a data source (from a database, OData or REST service) Radzen creates the so called data source methods (or operations).
For example if your database has an "Orders" table Radzen will generate CRUD methods for manipulating that table:
${result}
property.${result}
property.The Invoke data source method action can trigger one of two events - Then (on successful response) and Error (otherwise).
Important! You must handle the Then event in order to use the data source method result.
${result}
expression.
Usually you would set a property whose Value is set to ${result}
.
${result}
expression.
The Invoke custom method action allows you to invoke a custom C# or VB.NET action method. Custom methods implement business logic or run a complex DB query. More information is available in the Invoke custom method article.
Important! This action type is available only if the current Radzen application has server-side support enabled.
Navigates to the specified page with the specified parameters.
parameters
page property.
You can define unlimited number of parameters for the selected page navigate and you can specify Name and Value for each parameter where Value can be constant or expression.
Navigates to the previous page.
Opens the specified page in a modal dialog. Also allows the developer to pass parameters to the dialog and get a ${result}
via the Then
event.
parameters
page property.
You can define unlimited number of parameters for the selected dialog open and you can specify Name and Value for each parameter where Value can be constant or expression.
When you use the Close dialog action you can optionally set its Result property to some expression.
This expression will be available in the Then event of the Open dialog action as the ${result}
implicit property.
Displays the specified type of notification.
Sets the specified property to the specified value. The value should be a constant or expression. If a property with the specified name does not exist it will be created. Otherwise its value will be updated.
Executes the specified TypeScript code.
This type of action is similar to Invoke data source method action. It makes an HTTP request to the URL that represents the data source method and exports the result to specified format (CSV or Microsoft Excel). Only data from Microsoft SQL Server, MySQL, Oracle and PostgreSQL data-sources can be exported.
Radzen is free to use. You can also test the premium features for 15 days.
Download NowSelect theme: