blob: 9d96af42c468e153dacc868d1af43cdb540f7083 (
plain)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
<%@ Title="Post Management" %>
<com:TContent ID="Main">
<h2>Administration Center</h2>
<com:Application.Pages.Admin.AdminMenu />
<com:TDataGrid ID="PostGrid"
AutoGenerateColumns="false"
DataKeyField="ID"
CssClass="grid"
HeaderStyle.CssClass="grid-header"
ItemStyle.CssClass="grid-row1"
SelectedItemStyle.CssClass="grid-row-selected"
AlternatingItemStyle.CssClass="grid-row2"
AllowPaging="true"
AllowCustomPaging="true"
PageSize="20"
PagerStyle.CssClass="grid-pager"
PagerStyle.Mode="Numeric"
OnPageIndexChanged="changePage"
OnPagerCreated="pagerCreated"
OnEditCommand="editItem"
OnUpdateCommand="saveItem"
OnCancelCommand="cancelItem"
>
<com:THyperLinkColumn
HeaderText="Title"
DataNavigateUrlField="ID"
DataNavigateUrlFormatString="#$this->Service->constructUrl('Posts.ViewPost',array('id'=>{0}))"
DataTextField="Title"
/>
<com:THyperLinkColumn
HeaderText="Author"
DataNavigateUrlField="AuthorID"
DataNavigateUrlFormatString="#$this->Service->constructUrl('Users.ViewUser',array('id'=>{0}))"
DataTextField="AuthorName"
/>
<com:TTemplateColumn
HeaderText="Status"
ItemStyle.HorizontalAlign="Center"
ItemStyle.Width="90px" >
<prop:ItemTemplate>
<%#
$this->Parent->DataItem->Status===0 ?
'Published' :
($this->Parent->DataItem->Status===1 ?
'Draft' :
($this->Parent->DataItem->Status===2 ? 'Pending' : 'Sticky'))
%>
</prop:ItemTemplate>
<prop:EditItemTemplate>
<com:TDropDownList ID="PostStatus" SelectedValue=<%# $this->Parent->DataItem->Status %> >
<com:TListItem Value="0" Text="Published" />
<com:TListItem Value="1" Text="Draft" />
<com:TListItem Value="2" Text="Pending" />
<com:TListItem Value="3" Text="Sticky" />
</com:TDropDownList>
</prop:EditItemTemplate>
</com:TTemplateColumn>
<com:TBoundColumn
HeaderText="Time"
ReadOnly="true"
DataField="ModifyTime"
DataFormatString="#date('M j, Y',{0})"
ItemStyle.Wrap="false"
ItemStyle.Width="90px"
ItemStyle.HorizontalAlign="Center"
/>
<com:TEditCommandColumn
HeaderText="Command"
HeaderStyle.Width="80px"
UpdateText="Save"
ItemStyle.HorizontalAlign="Center"
ItemStyle.Wrap="false"
ItemStyle.Width="80px"
/>
</com:TDataGrid>
</com:TContent>
|