EXT NET GridPanel列表增刪改預覽
阿新 • • 發佈:2018-12-21
<ext:GridPanel ID="GridPanel1" runat="server" Title="新聞列表" Width="840" AutoHeight="true"Frame="false" StoreID="Store1" Icon="Information"> <TopBar> <ext:Toolbar ID="Toolbar1" runat="server"> <Items> <ext:Button ID="Add" runat="server" Text ="新增新聞" Icon="TableAdd"> <Listeners> <Click Handler="News.BindNewsCate();#{Window1}.show();" /> </Listeners> </ext:Button> <ext:TextField ID="txtNewKey" runat="server" AllowBlank="false" EmptyText="請輸入搜尋關鍵字!"> </ext:TextField> <ext:Button ID="btnSearch" runat="server" Text="查 找" Icon="Find"> <AjaxEvents> <Click OnEvent="SearchNews"> <EventMask ShowMask="true" Msg="正在搜尋..." /> </Click> </AjaxEvents> </ext:Button> </Items> </ext:Toolbar> </TopBar> <ColumnModel runat="server" ID="ct102"> <Columns> <ext:Column ColumnID="id" DataIndex="Id" Width="60" Header="序號" Hidden="false"> <PrepareCommand Handler="" Args="grid,command,record,row,col,value" FormatHandler="False"> </PrepareCommand> </ext:Column> <ext:Column ColumnID="title" DataIndex="Title" Width="150" Header="新聞標題"> <PrepareCommand Handler="" Args="grid,command,record,row,col,value" FormatHandler="False"> </PrepareCommand> </ext:Column> <ext:Column ColumnID="content" DataIndex="Content" Width="280" Header="新聞內容"> <PrepareCommand Handler="" Args="grid,command,record,row,col,value" FormatHandler="False"> </PrepareCommand> </ext:Column> <ext:Column ColumnID="category" DataIndex="Category" Width="100" Header="新聞分類"> <PrepareCommand Handler="" Args="grid,command,record,row,col,value" FormatHandler="False"> </PrepareCommand> </ext:Column> <ext:Column ColumnID="newsTime" DataIndex="NewsTime" Width="100" Header="釋出時間"> <PrepareCommand Handler="" Args="grid,command,record,row,col,value" FormatHandler="False"> </PrepareCommand> </ext:Column> <ext:ImageCommandColumn Width="100" Header="操作" ColumnID="Comman" Resizable="true"> <Commands> <ext:ImageCommand CommandName="Delete" Icon="TableDelete" Text="刪除"> <ToolTip Text="Delete" /> </ext:ImageCommand> <ext:ImageCommand CommandName="Edit" Icon="TableEdit" Text="編輯"> <ToolTip Text="Edit" /> </ext:ImageCommand> </Commands> <PrepareGroupCommand Handler="" Args="grid,command,groupId,group" FormatHandler="False"> </PrepareGroupCommand> <PrepareCommand Fn="prepareCommand" /> </ext:ImageCommandColumn> <ext:Column ColumnID="details" DataIndex="Id" Width="50" Header="預覽" Sortable="false"MenuDisabled="true"> <PrepareCommand Handler="" Args="grid,command,record,row,col,value" FormatHandler="False"> </PrepareCommand> <Renderer Fn="details" /> </ext:Column> </Columns> </ColumnModel> <SelectionModel> <ext:RowSelectionModel runat="server" ID="rowselect"> </ext:RowSelectionModel> </SelectionModel> <LoadMask ShowMask="true" Msg="正在載入..." /> <BottomBar> <ext:PagingToolbar runat="server" PageSize="15" StoreID="Store1" ID="paging"> </ext:PagingToolbar> </BottomBar> <Listeners> <Command Fn="gridCommand" /> </Listeners><%--<AjaxEvents> <Command OnEvent="OnCommand_Click"> <ExtraParams> <ext:Parameter Name="type" Value="command" Mode="Raw"> </ext:Parameter> <ext:Parameter Name="id" Value="record.data.Id" Mode="Raw"> </ext:Parameter> </ExtraParams> </Command> </AjaxEvents>這裡註釋掉的部分就是,可以後臺判斷編輯刪除的,Parameter是傳向後臺的引數--%></ext:GridPanel>