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.

Apply pipe to datatable data

See original GitHub issue

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

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

Current behavior No documentation or way to apply pipe to a column values

Expected behavior An option to apply pipe to column values. For example: Datatable shows 1497629491 which is a timestamp - which can be converted to actual date using pipe

Reproduction of the problem Irreleavnt

What is the motivation / use case for changing the behavior? Essential feature

Please tell us about your environment: Irreleavnt

  • Table version: 0.8.x 9.3.0

  • Angular version: 2.0.x 4.4.2

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ] All

  • Language: TS

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:15

github_iconTop GitHub Comments

1reaction
ghostcommented, Jan 2, 2019

I prefer to pass json to columns in data-table. You could use a custom Pipe as below -

# Component
tableColums = [
    { name: 'Title', prop: 'title' },
    { name: 'Actual Price', prop: 'actual_price', pipe: { transform: this.currencyPipe } },
    { name: 'Valid till', prop: 'valid_till.iso', pipe: { transform: this.datePipe } },
]
# HTML
<ngx-datatable [columns]="tableColumns"  [rows]='offers'
    ... # truncated for brevity
</ngx-datatable>

what is this.datePipe? and how do i transform timestamp to ‘MM/dd/yyyy’ format?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 2 Pipe ShortDate on NGX Data Table - Stack Overflow
The pipe @Input in the ngx-dataTable expects a Pipelike structure with a transform: Function. you could make any function that returns a ...
Read more >
Using data.table with magrittr pipes: best of both worlds
Should we use magrittr pipes with data.table? ... Use Case: Combining magrittr pipes and data.table I've once worked on a piece of analysis ......
Read more >
How to create custom pipe to filter data in DataTable or ngFor ...
Given simple example of creating custom pipe to filter data based on status of data. Here used data table for listing and pagination...
Read more >
Join Operations using Pipe - FusionCharts
Pipe is an operation which lets you run two or more data operations in a sequence. Instead of applying multiple filters one by...
Read more >
Search in two columns with multiple values separated by a pipe
dataTable.ext.search.push(function (settings, data, dataIndex) { var comp = $('#search-me').val(); let vName = ""; let vFatherName = "";
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