Hi there, running the latest build (1.5.8) of UD. When using a New-UDTable, the -pagesize parameter doesn’t seem to be working. All records are displayed regardless of the number set. Weirdly, the navigator down the bottom shows the correct page size. In this example, pagesize is set to 10, however all 67 records are displayed on the page. Using the right and left arrows does nothing.
I get the feeling something hasn’t finished processing or isn’t entirely resolved, but the ‘Loading…’ message has gone and all other functionality in the table is working.
Are you using the -TotalCount parameter as mentioned here:-
Are you also able to post an example of your code for the table if this suggestion does not fix your issue, then sure those who are using PU will be able to advise more.
No problems @mmcdougall I still need to get on and use PU have you tried invoking the variable on the -TotalCount parameter something like:- $($Data).Count
I know I had to do this sort of thing to make sure some stuff reads properly if you get me. Probably a typo but you mention $data then you are calling $Data in the parameter set…as mentioned probab a copy paste typo thing but also look into that
Yep @psDevUk definitely tried with and without, the count is returning the correct integer. Spent a while thinking that was the cause.
When this happened in the ‘traditional’ version of Universal Dashboard, it was because an element of the dashboard hadn’t finished loading, and any dynamic elements like buttons in columns would refuse to respond. On this occasion however the dashboard loads and responds exactly as expected however doesn’t conform to the pagesize set, which is causing somewhat of a UX issue, especially when you have 500+ lines.
Ok so if the query takes some time to process I tend to use the Timeout parameter on my SQL query to make sure it has plenty of time to run…also just out of curiosity have you tried putting the data into a $Cache variable name and load the data from cache variable instead of on-the-fly just thinking of other ways…hope this helps…?
Also not seeing you specifying the columns like in the examples on Build Server-Side tables with PowerShell Universal Dashboard
and not seeing the -Sort parameter being used…this may or maynot solve the issue?
I haven’t looked at $Cache but as other tables in my dashboard have the same issue even with minimal amounts of data to load, I don’t think this is going to be the culprit. Do you know of any examples to use this? The table needs to load on demand as the data changes minute to minute, not sure if that approach will still work?
Have also tried -sort and basically every other switch available to no avail.
Again I am not using PU just yet, but as I do follow @adam on twitter I saw he tweeted this the other day:-
Hoping there will be an example in there you can use, and be like… ah I see…
I mean I would have hoped like doing a copy and paste of the example on the linkn in my previous post should render the results you require…
In UD I have used CACHE when needed to from SQL, and you can set the update to say 1 min 5 mins etc…but yeah if all your tables having this…I always use GitHub - sqlcollaborative/Invoke-SqlCmd2: PowerShell module containing Invoke-SqlCmd2 to do my SQL queries…then pass the data from that…not sure what you using for the SQL connection? Assuming you are using SQL…?
Hi @AlonGvili, yep, I use server side with the -loaddata switch. The code is basically an import-module followed by a couple of gets in a foreach, which generates a hashtable to Out-UDTableData.