How to set one column based if condition
How to set one column based if condition
simaRa
Posts: 6Questions: 3Answers: 0
Hi everyone
I want to set value of one column based one condition
if (account_id=='-1)
{data: 'colleague_id', name: 'colleagues.fullname'},
else
{data: 'account_id', name: 'account.account_alias'},
I dont want to set it in controller beacuse its filtering makes error
Thanks
This discussion has been closed.
Answers
Hi @simaRa ,
You would do that in
columns.render
,Cheers,
Colin
can you help me How can I do it
In fact, I need to change the name of the column for filtering
{
data: 'account_id',
render: function(data, type, row) {
if (data=='-1') {
name: 'account.account_alias'
}
else
name:'colleagues.colleague_fullname'
}
},
This is not working
Your render function needs to return a value.