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  | ....      | ....
有帮助吗?

解决方案

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;
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top