Skip to content
This repository has been archived by the owner on Dec 4, 2019. It is now read-only.

Concatenate data, or show two fields like FName and LName in dynamic cells #268

Open
msholly opened this issue Jan 19, 2017 · 1 comment

Comments

@msholly
Copy link

msholly commented Jan 19, 2017

Hi! Loved the features of Angular Data Table, but came across a issue. We return first and last name in separate json fields, and I couldn't find a native way to display two "prop" in the same field.

I know I can use expressive markup to load it into a hard coded column design, that works just fine. But I mostly switched to Angular Data Table for the draggable and configurable column features. I'm using the Column Add demo as the base.

Tried this:
$scope.cur = [ { name: "Full Name", prop: "fname lname", width: 200 } ];

From this (simplified) data:
"fname":"John","lname":"Smith"

I suppose I can concatenate in another function, and push a new field called "fullname", but that really adds complexities to the app.

Thanks for any help!

@jonshaffer
Copy link

You'll want to use the cell renderer for this, and you probably wouldn't need to set a prop. Check out this pen for an example:
http://codepen.io/properjon/pen/jyxddZ

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants