Skip to content

Commit 9ae8d97

Browse files
search bar under pagination block
1 parent 5793909 commit 9ae8d97

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

example/index.html

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
<a onclick="rSoon(this)">9</a>,
4242
<a onclick="rSoon(this)">10</a>,
4343
<a onclick="rSoon(this)">11</a>,
44-
<a onclick="rSoon(this)">12</a>
44+
<a onclick="rSoon(this)">12</a>,
45+
<a onclick="rSoon(this)">13</a>
4546
</div>
4647
<div id="mdx"></div>
4748
<form id="mdxForm" onsubmit="return false;">
@@ -81,7 +82,11 @@
8182
".[H1].[Region].Members ON 0,NON EMPTY [DateOfSale].[Actual].[YearSold].Members ON 1 FROM [HoleFoods]",
8283
DrillDownExpression: "NONEMPTYCROSSJOIN([DateOfSale].[Actual].[YearSold].Members,[Product].[P1].[Product Category].Members)"
8384
},
84-
"SELECT NON EMPTY [AgeD].[H1].[Age Group].Members ON 0,NON EMPTY HEAD(NONEMPTYCROSSJOIN([DocD].[H1].[Doctor].Members,[AllerSevD].[H1].[Allergy Severities].Members),2000) ON 1 FROM [Patients]"
85+
"SELECT NON EMPTY [AgeD].[H1].[Age Group].Members ON 0,NON EMPTY HEAD(NONEMPTYCROSSJOIN([DocD].[H1].[Doctor].Members,[AllerSevD].[H1].[Allergy Severities].Members),2000) ON 1 FROM [Patients]",
86+
{
87+
basicMDX: 'SELECT NON EMPTY {[Measures].[%COUNT],%LABEL([Measures].[Avg Age],"Avg Age (ex. 1)",""),%LABEL([Measures].[Avg Age],"Avg Age (ex. 2)",""),%LABEL([Measures].[Avg Age],"Avg Age (ex. 3)","")} ON 0,NON EMPTY [AllerSevD].[H1].[Allergy Severities].Members ON 1 FROM [Patients]',
88+
pivot: "Pivot Features/Conditional Formatting.pivot"
89+
}
8590
][v],
8691
setup;
8792

@@ -124,14 +129,24 @@
124129
//, enableSearch: false // enables search panel in listing
125130
};
126131

132+
var e;
133+
127134
if (req.DrillDownExpression) { // set custom DrillDown on variant 10
128135
setup.DrillDownExpression = req.DrillDownExpression;
129-
var e = document.createElement("div");
136+
e = document.createElement("div");
130137
e.innerHTML = "<b>Custom DrillDown expression set up here: </b>"
131138
+ setup.DrillDownExpression;
132139
document.getElementById("mdxForm").appendChild(e);
133140
}
134141

142+
if (req.pivot) {
143+
setup.dataSource.pivot = req.pivot;
144+
e = document.createElement("div");
145+
e.innerHTML = "<b>Pivot attached here: </b>"
146+
+ req.pivot;
147+
document.getElementById("mdxForm").appendChild(e);
148+
}
149+
135150
document.getElementById("mdxForm").addEventListener("submit", function () {
136151

137152
var yourMDX = document.getElementById("yourMDX").value;

source/css/LightPivot.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@
369369
position: absolute;
370370
box-sizing: border-box;
371371
overflow: hidden;
372-
bottom: 20px;
372+
bottom: 0;
373373
width: 100%;
374374
height: 20px;
375375
font-size: 14px;

source/js/PivotView.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,8 +1065,9 @@ PivotView.prototype.renderRawData = function (data) {
10651065
searchInput.className = "lpt-searchInput";
10661066
searchSelect.className = "lpt-searchSelect";
10671067
if (pageSwitcher) {
1068-
searchBlock.style.borderBottom = "none";
1069-
} else { searchBlock.style.bottom = "0"; }
1068+
pageSwitcher.style.borderBottom = "none";
1069+
pageSwitcher.style.bottom = "20px";
1070+
}
10701071
for (i in searchFields) {
10711072
td = document.createElement("option");
10721073
td.setAttribute("value", searchFields[i].columnIndex.toString());

0 commit comments

Comments
 (0)