Hello everyone, I’m back again. I’m just getting started with Universal Dashboard and have been hitting quite a few roadblocks mainly related to my own stupidity. Currently, I’m attempting to use the Sync-UDElement cmdlet to resync a table, allowing me to update it’s contents. This seems fairly straight forward, but regardless of what I do, nothing seems to update the table. Are tables incapable of being synced?
In the below code snippet, when the “EDIT” button is clicked, the Domain ID should become “BOOP!” (demonstration purposes only, I swear), and the Renewal Status should become a dropdown box, but nothing happens. I also included a toast message just to ensure the EditDomain variable was being set correctly, which it is.
I also noticed these three errors in Chrome’s dev console:
hey @jmknight2 my Friday nights dont get much better than dashboarding so looking into this now…hopefully I can get you something soon…sorry @jmknight2 the mrs was hungry so just eaten a lovely chinese take-away…After some noodle goodness I came up with this:-
Shows how you can sync a ud table. Hope this helps fella
I tried to replicate your dashboard (apart from the data) as in using cached varibles…and you had a button, so thought of this generic example to hopefully get what you want working.
Thanks for the response! Chinese take-out certainly sounds great right about now!
Just a quick question though. Perhaps I’m mistaken, but doesn’t your sample script suffer from the same issue, where you can’t directly sync the table via Sync-UDElement? From what I can tell, the table only updates every 5 seconds as per the refresh interval, and not as a result of the call to Sync-UDElement.
The issue with this method is that it causes the effected elements to be physically redrawn in the DOM every cycle. In my tests this has caused the elements to flicker among other issues. My current workaround is to change the necessary variables, then refresh the page, thus causing the table’s endpoint to be recalled and syncing it’s data based on the new data.
It’s a somewhat clunky solution I know, but for the moment, it’s workable.
Hi @jmknight2 happy to hear you have a workaround, it was pretty late when I done that script, changing the refresh interval to 1 second does make it instant change. I personally never tried to sync a table before, I prefer to use grids on my dashboard, as end user can filter those. I have the sync working sweetly on my dashboard project I uploaded in the show off section, which I have also put on github…have you read https://poshtools.com/2018/11/13/dynamically-updating-controls-with-sync-udelement/ as thats what helped me
Hi @psDevUK one thing i have noticed in 2.4.1 as well is when you use the sync-udelement the out-udgridata data will be refreshed but it will remove your filter.
so for example i have a dshboard setup to output services and their status so when you filter by service name in previews ud releases and click a button to start or stop a service and click another button to sync the status will be updated and your filter for the service name retain.
with 2.4.1 release doing the same will refresh the whole out-udgridata and you have to filter by service name again to see the status.