You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: knowledge-base/tooltip-no-update-from-main-model.md
+93-20Lines changed: 93 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,62 +60,135 @@ This means that its content is no longer a sibling or child of the current compo
60
60
61
61
## Solution
62
62
63
-
The solution is to encapsulate the desired content in its own component so that its own logic and view-model updates itself and its own rendering, and changes from the parent component also fire up its `OnParametersSet` method so it can also re-render as needed.
63
+
Encapsulate the desired Tooltip content in a separate child component that has its own logic and component life cycle. This will help with the rendering updates. You can expose the necessary parameters and events, so that there are no API changes in the view-model of the main component
64
64
65
-
You can expose the necessary parameters and events from it so that there are no API changes in the view-model of the main component
65
+
Note that the child component will call its `OnParametersSet` method only on Tooltip display. If you need `OnParametersSet` to execute on each parameter change from the parent component, then use two nested components inside the Tooltip template.
66
66
67
67
<divclass="skip-repl"></div>
68
-
````RAZOR MainComponent
69
-
@* The API is the same, the contents are in their own component, see the adjacent tab *@
70
68
71
-
<TelerikButton Class="search-tooltip" ThemeColor="primary">Click for tooltip</TelerikButton>
69
+
````RAZOR Home.razor
70
+
<TelerikButton Class="search-tooltip-target" ThemeColor="@ThemeConstants.Button.ThemeColor.Primary">Click to Show Tooltip</TelerikButton>
0 commit comments