Skip to content

Commit 3aa0cc4

Browse files
committed
Version 1.0.78
Fixed a bug in error handling. getFilterValues now only returns either the form or the inline (not both). Add resetFilterValues.
1 parent 95d9382 commit 3aa0cc4

File tree

5 files changed

+21
-14
lines changed

5 files changed

+21
-14
lines changed

Build/CommonAssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
//
1616
// You can specify all the values or you can default the Revision and Build Numbers
1717
// by using the '*' as shown below:
18-
[assembly: AssemblyVersion("1.0.77.3")]
19-
[assembly: AssemblyFileVersion("1.0.77.3")]
18+
[assembly: AssemblyVersion("1.0.78.0")]
19+
[assembly: AssemblyFileVersion("1.0.78.0")]

Griddly.Mvc/GriddlyResult.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ public virtual long GetCount()
250250
return _result.Count();
251251
}
252252

253-
static IQueryable<T> ApplySortFields(IQueryable<T> source, SortField[] sortFields)
253+
protected static IQueryable<T> ApplySortFields(IQueryable<T> source, SortField[] sortFields)
254254
{
255255
IOrderedQueryable<T> sortedQuery = null;
256256

Griddly.Mvc/GriddlySettingsResult.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ public static GriddlySettings GetSettings(ControllerContext context, string view
6161
{
6262
throw;
6363
}
64-
catch
65-
{
66-
return null;
67-
}
6864
}
6965

7066
class EmptyHttpContext : HttpContextBase

Griddly/Scripts/griddly.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,7 @@
178178

179179
$("form .grid_searchreset", this.$element).on("click", $.proxy(function (event)
180180
{
181-
this.$element.find("form .transient").remove();
182-
this.$element.find("form")[0].reset();
183-
184-
this.refresh(true);
181+
this.resetFilterValues();
185182
}, this));
186183

187184
$("a.btn-search", this.$element).on("click", $.proxy(function (event)
@@ -696,9 +693,11 @@
696693

697694
getFilterValues: function()
698695
{
699-
var allFilters = $(".griddly-filters input, .griddly-filters select", this.$element).add(this.$inlineFilters);
696+
var visibleFilters = $(".griddly-filters-inline:visible input, .griddly-filters-inline:visible select, .griddly-filters-form div:visible input, .griddly-filters-form div:visible select", this.$element);
697+
// We don't want to include these, cause they may be hidden. ".griddly-filters:visible input" should get the ones we care about
698+
// .add(this.$inlineFilters);
700699

701-
return serializeObject(allFilters);
700+
return serializeObject(visibleFilters);
702701
},
703702

704703
setFilterValues: function(filters, isPatch)
@@ -724,6 +723,18 @@
724723
this.refresh(true);
725724
},
726725

726+
resetFilterValues: function ()
727+
{
728+
// TODO: get defaults?
729+
730+
this.$element.find("form .transient").remove();
731+
this.$element.find("form")[0].reset();
732+
733+
this.$element.trigger("resetfilters.griddly", this.$element);
734+
735+
this.refresh(true);
736+
},
737+
727738
buildRequest: function(paging)
728739
{
729740
var postData = this.getFilterValues();

Griddly/Views/Shared/Griddly/Griddly.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
<td colspan="@settings.Columns.Count">@settings.Title</td>
8383
</tr>
8484
}
85-
<tr class="griddly-filters" style="@(settings.FilterTemplate == null || !settings.ShowFilterInitially ? "display:none" : null)">
85+
<tr class="griddly-filters griddly-filters-form" style="@(settings.FilterTemplate == null || !settings.ShowFilterInitially ? "display:none" : null)">
8686
<td colspan="@settings.Columns.Count">
8787
<form class="filterForm novalidate">
8888
@if (settings.FilterTemplate != null)

0 commit comments

Comments
 (0)