Question

I want to combine multiple properties form the data item into a cell on slick grid. I was checking through the samples but did not find anything similar. The column formatter will just have access to current property.

say for example I have a json object:

{FirstName: 'abc', LastName: 'def', ContactNumber: '....', Email: '....'}

can I combine FirstName and LastName in to a cell?

the resulting grid will look like this:

Name     | Contact No|  Email
abc def  | ....      | ....
Was it helpful?

Solution

Posting answer for completion. @idbehold mentioned the answer in the comment.

The formatter function looks like this:

function nameFormatter(row, cell, value, columnDef, dataContext)
{
    return dataContext.FirstName + ' ' + dataContext.LastName;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top