mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#18944: Fixing paging in Content Picker
Work Item: 18944 --HG-- branch : 1.x
This commit is contained in:
@@ -45,6 +45,7 @@ namespace Orchard.ContentPicker.Controllers {
|
||||
? contentTypeDefinition.DisplayName
|
||||
: contentTypeDefinition.Name;
|
||||
query = query.ForType(model.Options.SelectedFilter);
|
||||
|
||||
}
|
||||
|
||||
switch (model.Options.OrderBy) {
|
||||
@@ -79,6 +80,10 @@ namespace Orchard.ContentPicker.Controllers {
|
||||
.Options(model.Options)
|
||||
.TypeDisplayName(model.TypeDisplayName ?? "");
|
||||
|
||||
// retain the parameter in the pager links
|
||||
RouteData.Values["Options.SelectedFilter"] = model.Options.SelectedFilter;
|
||||
RouteData.Values["Options.OrderBy"] = model.Options.OrderBy.ToString();
|
||||
|
||||
return new ShapeResult(this, Services.New.ContentPicker().Tab(tab));
|
||||
}
|
||||
|
||||
|
@@ -64,9 +64,11 @@
|
||||
$("ul a").each(function () {
|
||||
var self = $(this);
|
||||
var link = self.attr("href");
|
||||
var url = link.split("?");
|
||||
|
||||
// if the link doesn't define the "callback" query string, then append it
|
||||
// n.b., pagers already append it
|
||||
if (query("callback", link).length == 0) {
|
||||
if (url.length == 1 || query("callback", "?" + url[1]).length == 0) {
|
||||
link = link + "?callback=" + query("callback");
|
||||
self.attr("href", link);
|
||||
}
|
||||
|
@@ -75,6 +75,9 @@ namespace Orchard.Search.Controllers {
|
||||
item.Metadata.Type = "ContentPicker";
|
||||
}
|
||||
|
||||
// retain the parameter in the pager links
|
||||
RouteData.Values["searchText"] = searchText;
|
||||
|
||||
dynamic tab = Services.New.SearchContentTab()
|
||||
.ContentItems(list)
|
||||
.Pager(pagerShape)
|
||||
|
Reference in New Issue
Block a user