Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New-UDGrid/ServerSideProcessing #42

Closed
mkellerman opened this issue Mar 16, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@mkellerman
Copy link

commented Mar 16, 2018

No navigation bar is showing up.

screen shot 2018-03-16 at 6 01 37 pm

@mkellerman

This comment has been minimized.

Copy link
Author

commented Mar 16, 2018

If I remove the -ServerSideProcessing, and do a query that returns more than 10 records, the navigation shows up.

@adamdriscoll adamdriscoll added the bug label Mar 17, 2018

@adamdriscoll adamdriscoll added this to the 1.5.2 milestone Mar 17, 2018

@adamdriscoll

This comment has been minimized.

Copy link
Member

commented Mar 22, 2018

@mkellerman Can you try setting TotalItems on Out-UDGridData?

$totalRows = Invoke-SqlCmd "SELECT COUNT(*) FROM xyz"
Invoke-SqlCmd "SELECT * FROM xyz" | Out-UDGridData -TotalItems $totalRows
@mkellerman

This comment has been minimized.

Copy link
Author

commented Mar 23, 2018

@adamdriscoll

This comment has been minimized.

Copy link
Member

commented Mar 25, 2018

After some more testing, I found that Invoke-SqlCmd was not returning a scalar value. This test passes integration:

$Dashboard = New-UDDashboard -Title "5k Downloads!" -Content {
    New-UDGrid -Title "Tweets" -Headers @("Id","User Name", "Tweet", "Date Time") -Properties @("id", "user", "tweet", "datetime") -Endpoint {
        $Count = (Invoke-SqlCmd -Database twitter -Query "SELECT COUNT(*) as tweetCount FROM tweets").tweetCount
        Invoke-SqlCmd -Database twitter -Query "SELECT id, [user], tweet, datetime FROM tweets WHERE id LIKE '%$filterText%' ORDER BY $sortColumn OFFSET $skip ROWS FETCH NEXT $take ROWS ONLY"  | Out-UDGridData -TotalItems $Count
    } -ServerSideProcessing -PageSize 4
}

Start-UDDashboard -Dashboard $Dashboard -Port 10001

I fixed the issue where piping Invoke-SqlCmd to Out-UDGridData (#43) didn't work so try adjusting accordingly but the above script works fine with the 1.5.2 code base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.