User Tools

Site Tools


widget_management

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
widget_management [2023/01/29 17:44] – [Defauling Widgets to User Dashboard] wtkadminwidget_management [2023/08/07 21:13] (current) – [Defaulting Widgets to User Dashboard] wtkadmin
Line 63: Line 63:
  
 The "copy" process copies the `wtkWidgetGroup_X_Widget` data for the associated wtkWidgetGroup with NULL UserUID values making the new set contain the wtkUsers.UID in the wtkWidgetGroup_X_Widget.UserUID value. The "copy" process copies the `wtkWidgetGroup_X_Widget` data for the associated wtkWidgetGroup with NULL UserUID values making the new set contain the wtkUsers.UID in the wtkWidgetGroup_X_Widget.UserUID value.
 +
 +===== Use Widgets to Update Data and Refresh Widget =====
 +
 +In the WTK Admin website if you have the Widget "Link to Page" and make that page "Use Modal Window", you can easily allow editing of data and have it update the widget upon saving.
 +
 +The **/wtk/widgets.php** page automatically passes `wtkWidgets`.`UID` to the **wtkModal** JS function which is passed as **id** parameter.  The PHP page you have it call will automatically store that value in the $gloId global variable.
 +
 +In your PHP page have the update buttons defined as follows:
 +
 +<code PHP>
 +$pgBtns = wtkModalUpdateBtns('../wtk/lib/Save','widgetRefresh');
 +</code>
 +
 +Make certain your PHP has the form defined as:
 +
 +<code PHP>
 +<form id="FwidgetRefresh" method="POST">
 +</code>
 +
 +Also in your PHP add this code to put the `wtkWidgets`.`UID` into a hidden field.
 +
 +<code PHP>
 +$pgHtm .= wtkFormHidden('WidgetUID', $gloId);
 +</code>
 +
 +
 +The "widgetRefresh" is then sent back via the **modalSave** JS function.  That retrieves the hidden WidgetUID value and passes it back via an AJAX call to **/wtk/widgets.php**.  Normally widgets.php returns several widgets but when called this way it receives the UID and returns only the specific Widget requested, updating it on the dashboard.
widget_management.txt · Last modified: 2023/08/07 21:13 by wtkadmin