May 16, 2012, 2:34 PM
[CLOSED] MVC Grid Problem Paging
First, I may be doing this completely differently than I should as I am not as familiar with Ext as other control sets, so please bear with me.
I have a grid where I want to, on the fly, repopulate the grid based on the parameter passed in the URL:
(e.g. URL - /_GetTeams/1, /_GetTeams/2 - etc. Please note that the parameter passed in is an EMPLOYEE ID, not a team ID.) In order to make this work, I have set up my grid's store proxy API to have a default read like this:
In order to accomplish this, I have events which capture the selected radio and switch off the value, and then the script reloads the grid store:
Any help is appreciated.
I have a grid where I want to, on the fly, repopulate the grid based on the parameter passed in the URL:
(e.g. URL - /_GetTeams/1, /_GetTeams/2 - etc. Please note that the parameter passed in is an EMPLOYEE ID, not a team ID.) In order to make this work, I have set up my grid's store proxy API to have a default read like this:
With prxy
.API.Read = Url.Content("~/Assignments/_GetTeams/") + MvcApplication.CurrentApplicationUser.EmployeeID.ToString()
End With
I also have pagination configured for my grid:.BottomBar(Sub(footer)
Dim pager As New Ext.Net.PagingToolbar()
With pager
.AutoDataBind=True
End With
footer.Add(pager)
End Sub)
Now, my initial load of the grid is autoloaded. However, I have radio buttons at the top of the page which allow for the changing of the view (the default is "My Teams"). Some options are "My Teams," "All Teams," "My Direct Reports" - etc. and my goal is not to completely post-back the whole page (hence the proxy).In order to accomplish this, I have events which capture the selected radio and switch off the value, and then the script reloads the grid store:
function RebindGrid(e) {
var linkRef = "/Assignments/_GetTeams/" + e.toString();
App.TeamGrid.store.proxy.api.read=linkRef;
App.TeamGrid.store.load();
}
The data being returned is correct and binds to the grind 100% correctly However, pagination does not work. The toolbar has the correct number of pages and total. The toolbar will even "paginate," (page number increments) but every row of data is returned every time. I didn't catch it for a while because most results are only 1 page, but "All Teams" is long. I am completely fine with returning all the data an doing client-side pagination, but I am open to handling it server-side if that is how it must be handled (the post definitely has the pagination info in it: http://server/Assignments/_GetTeams/...22ASC%22%7D%5D). However, most importantly, I am trying to figure out how the correct way to handle this scenario.Any help is appreciated.
Last edited by Daniil; May 18, 2012 at 5:00 PM.
Reason: [CLOSED]