PDA

View Full Version : [CLOSED] [2.0] RendererFormat.Date



Timothy
May 17, 2012, 7:10 PM
Hello,

Just curious, if I have the following code for a column in a GridPanel how would one show something like "Waiting ..." when the date is the minimum value?

What's the best practise?



models.Add(Html.X().Column()
.DataIndex("Completed")
.Renderer(new Renderer
{
Format = RendererFormat.Date,
FormatArgs = new string[] { "'l F j, Y h:i A'" }
} )
.Text("Completed")
);


Cheers,
Timothy

Daniil
May 17, 2012, 8:19 PM
Hi,

Well, you should set up a custom Renderer using Handler with a required logic.

<Renderer Handler="if (value.getTime() === minValue.getTime()) {
return 'Wating ...';
}

return Ext.util.Format.date(value, 'l F j, Y h:i A');" />

Timothy
May 18, 2012, 2:51 PM
Thanks, I also found that
if (Ext.isDate(value)) { ... } also worked as well.

Please close.

Cheers,
Timothy