Format Date in Custom Drop Down List in Ext.Net

Just set up a respective format function.
1
{date:date("Y-m-d")}
Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<%@ Page Language="C#" %>
 
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
 
< script runat = "server" >
     protected void Page_Load(object sender, EventArgs e)
     {
         if (!X.IsAjaxRequest)
         {
             Store store = this.ComboBox1.GetStore();
             store.DataSource = new object[]
             {
                 new object[] { DateTime.Now },
                 new object[] { DateTime.Now.AddDays(1) },
                 new object[] { DateTime.Now.AddDays(2) }
             };
             store.DataBind();
         }
     }
script >
 
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" >
< head runat = "server" >
     < title >Ext.Net Example title >
head >
< body >
     < form runat = "server" >
         < ext:ResourceManager runat = "server" />
         < ext:ComboBox
             ID = "ComboBox1"
             runat = "server"
             ValueField = "date"
             DisplayField = "date" >
             < Store >
                 < ext:Store runat = "server" >
                     < Reader >
                         < ext:ArrayReader >
                             < Fields >
                                 < ext:RecordField Name = "date" />
                             Fields >
                         ext:ArrayReader >
                     Reader >
                 ext:Store >
             Store >
             < Template runat = "server" >
                 < Html >
                     < tpl for = "." >
                         < div class = "list-item" >
                             {date:date("Y-m-d")}
                         div >
                     tpl >
                 Html >
             Template >
         ext:ComboBox >
     form >
body >
html >

你可能感兴趣的:(Web/桌面/系统研发,date,list,object,assembly,xhtml,html)