question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SummaryRow applies even when there is no SummaryFunc

See original GitHub issue

I’m submitting a … (check one with “x”)

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior

<ngx-datatable
    class="bootstrap"
    [summaryRow]="enableSummary"
    [summaryPosition]="summaryPosition"
    [columnMode]="'force'"
    [headerHeight]="40"
    [rowHeight]="'auto'"
    [rows]="rows">
    <ngx-datatable-column prop="name" name="Nome"></ngx-datatable-column>
    <ngx-datatable-column 
		prop="valorDocumento" 
		[summaryFunc]="summValorDocumento">
	</ngx-datatable-column>
</ngx-datatable>

Results in a footer summary row with: [ name1name2name3 | 1000 ]

Expected behavior Since I am not giving a summaryFunc for the first column prop=“name”, I expected a footer summary row like this: [ empty here | 1000 ]

Reproduction of the problem

Please tell us about your environment: OS: Windows 10 IDE: Visual Studio Code package manager: Yarn and NPM

  • Table version: 11.3.0 and 12.0.0

  • Angular version: 6.0.0 and 4.1.0

  • Browser: Chrome

  • Language: [all | TypeScript X.X | ES6/7 | ES5] TypeScript 2.4.2 and 2.7.2

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
SirWojtekcommented, May 14, 2018

Hello @cassianomon, thank you for creating the issue. I’ll try to look at your problem deeply in this week, I need to gather all possible solutions. As a workaround, I suggest you to “trick” template passing an empty function:

HTML

<ngx-datatable-column prop="name" name="Nome" [summaryFunc]="noop"></ngx-datatable-column>

TS

noop() { return null; } 
// or
noop() {}
1reaction
SirWojtekcommented, May 22, 2018

@cassianomon After I perform a couple of example usages of a summary row I must admit putting null on every non-number row can be a frustrating experience so I’ve decided to remove the throw statement from the default summary function.

PR containing the fix for this issue is ready to be reviewed. If you like to test it, you can download my branch and build it on your own.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jquery - ngx-datatable summary row is not working with ...
ngx-datatable summary row is not working with summaryFunc in column properties. Also all summary values are concatinating as string.
Read more >
swimlane/ngx-datatable - Gitter
I am using ngx-datatable with typescript, but for some reason in my case table is not rendering. It probably is not connected to...
Read more >
SummaryRow Property [Excel 2003 VBA Language ...
expression Required. An expression that returns one of the objects in the Applies To list. Remarks. Set SummaryRow to xlAbove for Microsoft Word ......
Read more >
Calculate a Custom Summary
Set the Summary Func property to Custom and use the Format String ... so that a pack will be taken into account //...
Read more >
ListGridField (Smart GWT LGPL Edition API 13.0p (2022- ...
Custom base style to apply to all cells in this field instead of ListGrid. ... even if it has no filter-value, or is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found