Hello,
I have a data source like:
var dataSource = [
{
User: {
ID: '123',
Name: {
First: 'Jack',
Last: 'Doson'
}
]
I want to show it in an igGrid, primary key is User.ID, column 'UserID' is User.ID, column 'UserName' is 'User.Name.First + User.Name.Last'.
How can I do it? Thanks!
I am glad that I've managed to help you.
Thank you for using our products.
Thank you very much!~~~
Yes you can, although your IF statement must be defined like:
I have modified the online sample:
http://jsfiddle.net/Wnf8q/5/
Thank you for your reply. Your code works!
Can I use fields other than Name in the template?
For example, I have a Gender filed:
var ds = { User: [{ ID: 123, Name: { First: 'Jack', Last: 'Doson' }, Gender: 'M' }] };
And I want to show Mr./Ms. according to the Gender in the template (fake code) as below:
Is it possible?
Hello Zach Shine,
Thank you for your reply,
I have changed my mind about the formatter, lets try something better, lets use our column template. With it we can fulfill your requirements. I have created a sample in order to show you my approach. Basically we have template with which we format First and Last name to be concatenated.
Code snippet:
Online sample:
http://jsfiddle.net/zdravko/Wnf8q/2/
Looking forward to hearing from you.