Skip to content

Commit 223758c

Browse files
committed
Merge pull request #40 from ithielnor/master
Remove scroll styles
2 parents cbc7e5f + fce6489 commit 223758c

File tree

7 files changed

+94
-61
lines changed

7 files changed

+94
-61
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.84.0")]
19-
[assembly: AssemblyFileVersion("1.0.84.0")]
18+
[assembly: AssemblyVersion("1.0.84.1")]
19+
[assembly: AssemblyFileVersion("1.0.84.1")]

Griddly/Content/griddly.css

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
border-radius: 4px;
1515
}
1616

17-
.griddly-scrollable-container
18-
{
19-
overflow-x:auto;
20-
clear:both;
21-
}
22-
2317
.griddly table
2418
{
2519
border-collapse: collapse;
@@ -92,7 +86,7 @@
9286
background-color: #f0f0f0;
9387
}
9488

95-
.griddly-scrollable-container::-webkit-scrollbar {
89+
/*.griddly-scrollable-container::-webkit-scrollbar {
9690
width: 8px;
9791
height:8px;
9892
}
@@ -104,12 +98,12 @@
10498
}
10599
.griddly-scrollable-container::-webkit-scrollbar-thumb:hover {
106100
background-color: #aaa;
107-
}
101+
}*/
108102

109103
.griddly-filter-popover .popover-content
110104
{
111105
padding:0;
112-
max-width:200px;
106+
width:200px;
113107
}
114108

115109
.filter-content

Griddly/Scripts/griddly.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@
602602
// TODO: figure out how to have griddly in modal and still use body container. as it is, something about the modal
603603
// blocks inputs in popovers from getting focus. so as a fallback I put it back in the bouding container,
604604
// which will work but means it will get cut off if griddly is scrollable
605-
container: this.$element.parents(".modal").length ? null : "body",
605+
container: el, // this.$element.parents(".modal").length ? null : "body",
606606
template: '<div class="popover griddly-filter-popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>',
607607
content: function ()
608608
{

Griddly/Views/Home/Examples.cshtml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@
44
<div class="row">
55
<div class="col-md-12">
66
<h2>@ViewBag.Title</h2>
7+
8+
<h3>Box/List Filter Example</h3>
79
@Html.Griddly("FilterBoxGrid", new { test = SortDirection.Ascending })
8-
<br />
10+
11+
<h3>Range Filter Example</h3>
912
<a href="javascript:GetFilterValues()">get filter values</a> | <a href="javascript:SetFilterValues()">set filter values</a>
1013
@Html.Griddly("FilterRangeGrid")
11-
<br />
14+
15+
<h3>Scrollable Example</h3>
1216
@Html.Griddly("FilterListGrid")
13-
<br />
17+
18+
<h3>Other Random Examples/Tests</h3>
1419
@Html.Griddly("TestGrid")
1520
</div>
1621
</div>
@@ -43,6 +48,33 @@
4348
{
4449
$(".filter-range-grid").griddly("setFilterValues", { companyStart: '53' });
4550
}
51+
52+
function Scrolly()
53+
{
54+
var grid = $(".griddly.filter-list-grid");
55+
var table = grid.find("table");
56+
57+
58+
// some basic changes to make the grid more conducive to scrolling
59+
grid.find(".griddly-scrollable-container").css({ "overflow": "auto", "height": "250px" });
60+
grid.find("thead td").css({ "background-color": "white" });
61+
grid.css({ "overflow": "hidden" });
62+
63+
grid.on("refresh.griddly", function ()
64+
{
65+
table.floatThead({
66+
scrollContainer: function ($table)
67+
{
68+
return $table.closest(".griddly-scrollable-container");
69+
}
70+
});
71+
});
72+
73+
grid.griddly("pageSize", 20);
74+
grid.griddly("refresh");
75+
76+
return false;
77+
}
4678
</script>
4779

4880
@section scripts{

Griddly/Views/Home/FilterBoxGrid.cshtml

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,34 @@
11

22
@{
33
ViewBag.Title = "TestGrid";
4+
5+
List<SelectListItem> groupedList = new List<SelectListItem>()
6+
{
7+
new SelectListItemGroup()
8+
{
9+
Text = "Group1",
10+
Items = new List<SelectListItem>()
11+
{
12+
new SelectListItem() { Text = "Item1", Value = "Item1" },
13+
new SelectListItem() { Text = "Item2", Value = "Item2" },
14+
new SelectListItem() { Text = "Item3", Value = "Item3" },
15+
new SelectListItem() { Text = "Item4", Value = "Item4" },
16+
new SelectListItem() { Text = "Item5", Value = "Item5" },
17+
}
18+
},
19+
new SelectListItemGroup()
20+
{
21+
Text = "Group2",
22+
Items = new List<SelectListItem>()
23+
{
24+
new SelectListItem() { Text = "Item6", Value = "Item6" },
25+
new SelectListItem() { Text = "Item7", Value = "Item7" },
26+
new SelectListItem() { Text = "Item8", Value = "Item8" },
27+
new SelectListItem() { Text = "Item9", Value = "Item9" },
28+
new SelectListItem() { Text = "Item10", Value = "Item10" },
29+
}
30+
}
31+
};
432
}
533

634
@Html.Griddly(new GriddlySettings<TestGridItem>()
@@ -16,10 +44,18 @@
1644
}
1745
.Column("test", template: @<a href="http://google.com">google</a>, summaryValue: "Total")
1846
.Column(x => x.Test, "Sum", format: "c", summaryFunction: SummaryAggregateFunction.Sum)
19-
.Column(x => x.Test, "Min", format: "c", summaryFunction: SummaryAggregateFunction.Min)
20-
.Column(x => x.Test, "Max", format: "c", summaryFunction: SummaryAggregateFunction.Max)
21-
.Column(x => x.Test, "Avg", format: "c", summaryFunction: SummaryAggregateFunction.Average)
22-
.Column(x => x.FirstName, "First Name")
47+
.Column(x => x.Test, "Min", format: "c", summaryFunction: SummaryAggregateFunction.Min)
48+
.Column(x => x.Test, "Max", format: "c", summaryFunction: SummaryAggregateFunction.Max)
49+
.Column(x => x.Test, "Avg", format: "c", summaryFunction: SummaryAggregateFunction.Average, filter: x => x.FilterList(groupedList))
50+
.Column(x => x.FirstName, "First Name", filter: x =>
51+
{
52+
GriddlyFilterList filter = x.FilterList(TestGridItem.UsStates);
53+
54+
filter.CaptionPlural = "State";
55+
filter.DisplayItemCount = 2;
56+
57+
return filter;
58+
})
2359
.Column(x => x.LastName, "Last Name", defaultSort: SortDirection.Ascending, filter: x => x.FilterBox(FilterDataType.String))
2460
.Column(x => x.Company, "Company", filter: x => x.FilterBox(FilterDataType.Decimal))
2561
.Column(x => x.Address, "Address", filter: x => x.FilterBox(FilterDataType.Currency))
Lines changed: 12 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,22 @@
11

22
@{
33
ViewBag.Title = "TestGrid";
4-
5-
List<SelectListItem> groupedList = new List<SelectListItem>()
6-
{
7-
new SelectListItemGroup()
8-
{
9-
Text = "Group1",
10-
Items = new List<SelectListItem>()
11-
{
12-
new SelectListItem() { Text = "Item1", Value = "Item1" },
13-
new SelectListItem() { Text = "Item2", Value = "Item2" },
14-
new SelectListItem() { Text = "Item3", Value = "Item3" },
15-
new SelectListItem() { Text = "Item4", Value = "Item4" },
16-
new SelectListItem() { Text = "Item5", Value = "Item5" },
17-
}
18-
},
19-
new SelectListItemGroup()
20-
{
21-
Text = "Group2",
22-
Items = new List<SelectListItem>()
23-
{
24-
new SelectListItem() { Text = "Item6", Value = "Item6" },
25-
new SelectListItem() { Text = "Item7", Value = "Item7" },
26-
new SelectListItem() { Text = "Item8", Value = "Item8" },
27-
new SelectListItem() { Text = "Item9", Value = "Item9" },
28-
new SelectListItem() { Text = "Item10", Value = "Item10" },
29-
}
30-
}
31-
};
324
}
335

346
@Html.Griddly(new GriddlySettings<TestGridItem>()
357
{
36-
PageSize = 5
8+
PageSize = 5,
9+
ClassName = "filter-list-grid"
3710
}
11+
3812
.Column(x => x.FirstName, "First Name")
39-
.Column(x => x.LastName, "Last Name", defaultSort: SortDirection.Ascending)
40-
.Column(x => x.City, "City", filter: x => x.FilterEnum<Title>())
41-
.Column(x => x.State, "State", filter: x =>
42-
{
43-
GriddlyFilterList filter = x.FilterList(TestGridItem.UsStates);
44-
45-
filter.CaptionPlural = "State";
46-
filter.DisplayItemCount = 2;
47-
48-
return filter;
49-
})
50-
.Column(x => x.Address, "Address", filter: x => x.FilterList(groupedList))
51-
.Column(x => x.PostalCode, "Gender", filter: x => x.FilterBool("YEAHH", "Naw", "what?"))
13+
.Column(x => x.LastName, "Last Name", defaultSort: SortDirection.Ascending)
14+
.Column(x => x.City, "City")
15+
.Column(x => x.State, "State")
16+
.Column(x => x.Address, "Address")
17+
.Column(x => x.PostalCode, "Gender")
18+
.Column(x => x.PostalCode, "Gender")
19+
.Column(x => x.PostalCode, "Gender")
20+
21+
.Button("Scrolly", "Scrollify with floatThead.js", action: GriddlyButtonAction.Javascript)
5222
)

Griddly/Views/Shared/_Layout.cshtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656

5757
@Scripts.Render("~/bundles/jquery")
5858
@Scripts.Render("~/bundles/bootstrap")
59+
<script src="https://cdnjs.cloudflare.com/ajax/libs/floatthead/1.2.10/jquery.floatThead.min.js"></script>
5960
@Scripts.Render("~/scripts/griddly.js")
6061
@Scripts.Render("~/scripts/bootstrap-multiselect.js")
6162
@Scripts.Render("~/scripts/SyntaxHighlighter/shCore.js")

0 commit comments

Comments
 (0)