Skip to content

Commit 97c9f41

Browse files
cell min width in listing option
1 parent 82971c5 commit 97c9f41

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

example/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
//, conditionalFormattingOn: true // enable conditional formatting rules
117117
//, defaultFilterSpecs: ["[Date].[H1].[month].&[]"] ] // default filters array
118118
//, drillDownTarget: "<dashboard name>" // undocumented, deepSee only
119+
, listingColumnMinWidth: 200 // minimal width of column in listing
119120
};
120121

121122
if (req.DrillDownExpression) { // set custom DrillDown on variant 10

export/LightPivotTable-DeepSeePortlet.xml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<Class name="DeepSee.LightPivotTable">
1313
<Super>%DeepSee.Component.Portlet.abstractPortlet</Super>
14-
<TimeChanged>63575,60589.683103</TimeChanged>
14+
<TimeChanged>63575,78017.533889</TimeChanged>
1515
<TimeCreated>63515,61322.546099</TimeCreated>
1616

1717
<Parameter name="INCLUDEFILES">
@@ -31,13 +31,17 @@
3131
</Property>
3232

3333
<Property name="Pagination">
34-
<Type>%Boolean</Type>
34+
<Type>%Integer</Type>
3535
</Property>
3636

3737
<Property name="FixTotals">
3838
<Type>%Boolean</Type>
3939
</Property>
4040

41+
<Property name="ListingColumnMinWidth">
42+
<Type>%Integer</Type>
43+
</Property>
44+
4145
<Method name="%OnGetPortletName">
4246
<ClassMethod>1</ClassMethod>
4347
<ReturnType>%String</ReturnType>
@@ -64,6 +68,7 @@
6468
set pInfo($I(pInfo)) = $LB("ExportCSV", 1, "%Boolean", $$$Text("Export to CSV", "%DeepSee"), "Show export to CSV format button")
6569
set pInfo($I(pInfo)) = $LB("Pagination", 0, "%Integer", $$$Text("Pagination", "%DeepSee"), "Enable pagination")
6670
set pInfo($I(pInfo)) = $LB("FixTotals", 0, "%Boolean", $$$Text("Fix totals", "%DeepSee"), "Fix totals in header")
71+
set pInfo($I(pInfo)) = $LB("ListingColumnMinWidth", 0, "%Integer", $$$Text("Min cell width for listing", "%DeepSee"), "Minimal column width in listing")
6772
6873
quit $$$OK
6974
]]></Implementation>
@@ -241,6 +246,9 @@
241246
if (parseInt(container.getAttribute("pagination"))) {
242247
setup["pagination"] = parseInt(container.getAttribute("pagination"))
243248
}
249+
if (parseInt(container.getAttribute("listingColumnMinWidth"))) {
250+
setup["listingColumnMinWidth"] = parseInt(container.getAttribute("listingColumnMinWidth"))
251+
}
244252
245253
_.LightPivotTable = new LightPivotTable(setup);
246254
@@ -337,7 +345,7 @@
337345
}
338346
339347
&html<
340-
<div fixTotals="#(..FixTotals)#" pagination="#(..Pagination)#" export-csv="#(..ExportCSV)#" data-source="#(..DataSource)#" show-summary="#(..ShowSummary)#" class="lpt-container" style="position: absolute; left: 0; bottom: 0; width: 100%; height: 100%;">
348+
<div listingColumnMinWidth="#(..ListingColumnMinWidth)#" fixTotals="#(..FixTotals)#" pagination="#(..Pagination)#" export-csv="#(..ExportCSV)#" data-source="#(..DataSource)#" show-summary="#(..ShowSummary)#" class="lpt-container" style="position: absolute; left: 0; bottom: 0; width: 100%; height: 100%;">
341349
342350
</div>
343351
>

source/js/PivotView.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,10 @@ PivotView.prototype.renderRawData = function (data) {
670670
);
671671
th.textContent = rawData[y][x].value || " ";
672672
if (rawData[y][x].style) th.setAttribute("style", rawData[y][x].style);
673+
if (info.leftHeaderColumnsNumber === 0
674+
&& _.controller.CONFIG["listingColumnMinWidth"]) { // if listing
675+
th.style.minWidth = _.controller.CONFIG["listingColumnMinWidth"] + "px";
676+
}
673677
if (rawData[y][x].className) th.className = rawData[y][x].className;
674678
if (rawData[y][x].group) renderedGroups[rawData[y][x].group] = {
675679
x: x,

0 commit comments

Comments
 (0)