Hi,
I have a grid with date column. If the date value is greater than 30 then i want to display the date value as is otherwise display the difference in days like "In x Days".
I able to display formatted date value or difference in days correctly using the below code.
div class="col-md-12" id="recurringPaymentList">
@(Html.Kendo().Grid<PaymentsModel>()
.Name("scheduledPayment")
.Columns(columns =>
{
columns.Bound(c => c.NextPaymentDate).ClientTemplate(
"#= ( Math.round((NextPaymentDate - new Date())/1000/60/60/24 ))>30 ? kendo.toString(NextPaymentDate, 'MM/dd/yyyy') : kendo.toString(Math.round((NextPaymentDate - new Date())/1000/60/60/24 )) #"
);
However, when i try to contenate string values (see code below) in the ternary expression grid data does not bind and i dont see any error.
columns.Bound(c => c.NextPaymentDate).ClientTemplate(
"#= ( Math.round((NextPaymentDate - new Date())/1000/60/60/24 ))>30 ? kendo.toString(NextPaymentDate, 'MM/dd/yyyy') : 'In ' + kendo.toString(Math.round((NextPaymentDate - new Date())/1000/60/60/24 )) " ' Day' #"
);
Is there any way to get the string contenate work in ternary expression or any other way of doing this?
I have a grid with date column. If the date value is greater than 30 then i want to display the date value as is otherwise display the difference in days like "In x Days".
I able to display formatted date value or difference in days correctly using the below code.
div class="col-md-12" id="recurringPaymentList">
@(Html.Kendo().Grid<PaymentsModel>()
.Name("scheduledPayment")
.Columns(columns =>
{
columns.Bound(c => c.NextPaymentDate).ClientTemplate(
"#= ( Math.round((NextPaymentDate - new Date())/1000/60/60/24 ))>30 ? kendo.toString(NextPaymentDate, 'MM/dd/yyyy') : kendo.toString(Math.round((NextPaymentDate - new Date())/1000/60/60/24 )) #"
);
However, when i try to contenate string values (see code below) in the ternary expression grid data does not bind and i dont see any error.
columns.Bound(c => c.NextPaymentDate).ClientTemplate(
"#= ( Math.round((NextPaymentDate - new Date())/1000/60/60/24 ))>30 ? kendo.toString(NextPaymentDate, 'MM/dd/yyyy') : 'In ' + kendo.toString(Math.round((NextPaymentDate - new Date())/1000/60/60/24 )) " ' Day' #"
);
Is there any way to get the string contenate work in ternary expression or any other way of doing this?