I have a jQuery combobox in which I want to display a name column and a date column.
@(Html
.Infragistics()
.Combo()
.ID("comboEvents")
.FilteringType(ComboFilteringType.None)
.ValueKey("eventId")
.TextKey("name")
.DropDownMinHeight(50)
.Width("300px")
.DataSource(Url.Action("EventListCombo"))
.ItemTemplate("<div>${name} (${date})</div>")
.DataBind()
.Render()
)
Obviously the date shows up as a JSON date ("/Date(1315540800000)/"). How can I get the jQuery date format to work within the above itemtemplate?
Check out this post in Stack Overflow. It involves using the native js Date object:
http://stackoverflow.com/a/2316066/732673
Not too sure that's going to help me with IG's itemtemplate...
Correct, no, you can't use the method I linked to directly in IG's itemtemplate. You'd convert the date values in your datasource using javascript, then send your datasource to igcombo with the dates already in an acceptable format.
There may be some way to have IG's datasource recognize JSON dates and display them formatted in the way you like, but it's not immediately apparent to me from looking at their documentation.
http://www.igniteui.com/help/api/2015.2/ig.datasource