1. 程式人生 > >Ext Net 1 x Ext Net Calendar日程管理

Ext Net 1 x Ext Net Calendar日程管理

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow

也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!

               

案列由網友上下左右提供!

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits
="WorkDiary_Default" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat
="server">
    <title>Calendar - Ext.NET Examples</title>    <ext:ResourcePlaceHolder runat="server" Mode="Style" />    <link rel="stylesheet" type="text/css" href="Style/Calendar.Css" />    <ext:ResourcePlaceHolder runat
="server" Mode="Script" />
    <script src="Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>    <script src="Scripts/kindeditor-4.1/kindeditor-min.js" type="text/javascript"></script>    <link href="Scripts/kindeditor-4.1/themes/default/default.css" rel="stylesheet"        type="text/css" />    <style type="text/css">        .ext-color-4, .ext-ie .ext-color-4-ad, .ext-opera .ext-color-4-ad        {            color: #7F0000;        }        .ext-cal-day-col .ext-color-4, .ext-dd-drag-proxy .ext-color-4, .ext-color-4-ad, .ext-color-4-ad .ext-cal-evm, .ext-color-4 .ext-cal-picker-icon, .ext-color-4-x dl, .ext-color-4-x .ext-cal-evb        {            background: #7F0000;        }        .ext-color-4-x .ext-cal-evb, .ext-color-4-x dl        {            border-color: #7C3939;        }        .icon-combo-item        {            background-repeat: no-repeat !important;            background-position: 3px 50% !important;            padding-left: 24px !important;        }    </style>    <script language="javascript" type="text/javascript">        var editor;        KindEditor.ready(function (K) {            editor = K.create('.txtArr', {                width: '470px',                height: '200px',                fullscreenShortcut: false,                newlineTag: '</br>',                resizeType: 0,                allowPreviewEmoticons: false,                allowImageUpload: false,                items: [      'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',      'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',      'insertunorderedlist', '|', 'emoticons', 'link']            });        });        var checkForm = function (form) {            if (form.form.isValid())                return true;            Ext.Msg.alert('驗證失敗', '請檢查被標記紅色浪線的資料是否正確');            return false;        };    </script></head><body>    <form id="Form1" runat="server">    <ext:ResourceManager runat="server" IDMode="Explicit" ScriptMode="Debug" RemoveViewState="true"        Namespace="CompanyX" ID="ResourceManager1" />    <ext:Store ID="Store1" runat="server" OnRefreshData="MyData_Refresh">        <Reader>            <ext:ArrayReader>                <Fields>                    <ext:RecordField Name="iconCls" />                    <ext:RecordField Name="name" />                    <ext:RecordField Name="value" />                </Fields>            </ext:ArrayReader>        </Reader>    </ext:Store>    <ext:Store ID="stYuanGong" runat="server" OnRefreshData="MyData_Refresh">        <Reader>            <ext:JsonReader>                <Fields>                    <ext:RecordField Name="id" />                    <ext:RecordField Name="UserName" />                </Fields>            </ext:JsonReader>        </Reader>    </ext:Store>    <ext:Viewport runat="server" Layout="Border">        <Items>            <ext:Panel ID="Panel1" runat="server" Title="" Layout="Border" Region="Center" Border="false"                Cls="app-center">                <TopBar>                    <ext:Toolbar ID="Toolbar2" runat="server">                        <Items>                            <ext:Label ID="Label1" runat="server">                            </ext:Label>                            <ext:ToolbarFill>                            </ext:ToolbarFill>                            <ext:ComboBox LabelAlign="Right" StoreID="stYuanGong" ValueField="id" DisplayField="UserName"                                Width="287" ID="drpXiangMuJL" runat="server" FieldLabel="選擇人員" Editable="false">                                <Triggers>                                    <ext:FieldTrigger Icon="Clear" HideTrigger="true" />                                </Triggers>                                <Listeners>                                    <BeforeQuery Handler="this.triggers[0][ this.getRawValue().toString().length == 0 ? 'hide' : 'show']();" />                                    <TriggerClick Handler="if (index == 0) { this.focus().clearValue(); trigger.hide();}" />                                    <Select Handler="this.triggers[0].show();" />                                </Listeners>                            </ext:ComboBox>                            <ext:Button ID="Button4" runat="server" Text="確定" Icon="Zoom">                                <DirectEvents>                                    <Click OnEvent="searchEvent">                                    </Click>                                </DirectEvents>                            </ext:Button>                        </Items>                    </ext:Toolbar>                </TopBar>                <Items>                    <ext:CalendarPanel ID="CalendarPanel1" runat="server" Region="Center" ActiveIndex="2"                         ShowDayView="false" ShowWeekView="false" Border="false" AutoRender="false" MonthText="月檢視">                        <GroupStore ID="GroupStore1" runat="server">                            <Groups>                                <ext:Group CalendarId="1" Title="Home" />                                <ext:Group CalendarId="2" Title="Work" />                                <ext:Group CalendarId="3" Title="Other" />                                <ext:Group CalendarId="4" Title="School" />                            </Groups>                        </GroupStore>                        <EventStore ID="EventStore1" DateFormat="M$" runat="server" SaveMappings="false" OnRefreshData="MyData_Refresh">                            <Reader>                            </Reader>                        </EventStore>                        <MonthView runat="server" ShowHeader="true" ShowWeekLinks="true" ShowWeekNumbers="true" />                        <DirectEvents>                            <DayClick OnEvent="dayclick">                                <ExtraParams>                                    <ext:Parameter Name="nnd" Mode="Raw" Value="dt">                                    </ext:Parameter>                                </ExtraParams>                            </DayClick>                            <RangeSelect OnEvent="rangeSelect">                                <ExtraParams>                                    <ext:Parameter Name="nnd" Mode="Raw" Value="dates ">                                    </ext:Parameter>                                </ExtraParams>                            </RangeSelect>                            <EventClick OnEvent="editEvents">                                <ExtraParams>                                    <ext:Parameter Name="ids" Mode="Raw" Value="record.data.EventId">                                    </ext:Parameter>                                    <ext:Parameter Name="Title" Mode="Raw" Value="record.data.Title">                                    </ext:Parameter>                                    <ext:Parameter Name="startday" Mode="Raw" Value="record.data.StartDate">                                    </ext:Parameter>                                    <ext:Parameter Name="endday" Mode="Raw" Value="record.data.EndDate">                                    </ext:Parameter>                                    <ext:Parameter Name="contens" Mode="Raw" Value="record.data.Notes">                                    </ext:Parameter>                                </ExtraParams>                            </EventClick>                            <EventMove OnEvent="MoveEvents">                                <ExtraParams>                                    <ext:Parameter Name="ids" Mode="Raw" Value="record.data.EventId">                                    </ext:Parameter>                                    <ext:Parameter Name="edate" Mode="Raw" Value="record.data.StartDate.format('F j' + (record.data.IsAllDay ? '' : ''))">                                    </ext:Parameter>                                </ExtraParams>                            </EventMove>                        </DirectEvents>                    </ext:CalendarPanel>                </Items>            </ext:Panel>        </Items>    </ext:Viewport>    <ext:Window ID="Window1" runat="server" Collapsible="true" Height="390" Icon="Application"        Title="Title" Width="550" Hidden="true" Resizable="false" BodyStyle="background:#CCD9E8">        <Items>            <ext:FormPanel Border="false" Width="500" AutoWidth="false" ID="FormPanel1" runat="server"                MonitorValid="true" BodyStyle="background:#CCD9E8">                <Items>                    <ext:TableLayout ID="TableLayout1" runat="server" Columns="2" AnchorHorizontal="99%"                        StyleSpec="margin-top:20px;">                        <Cells>                            <ext:Cell>                                <ext:TextField Width="250" LabelAlign="Right" LabelWidth="70" ID="txtTianJiaR" runat="server"                                    FieldLabel="新增人" AllowBlank="false" BlankText="新增人" Disabled="true">                                </ext:TextField>                            </ext:Cell>                            <ext:Cell>                                <ext:ComboBox ID="selColor" runat="server" Width="250" Editable="false" FieldLabel="設定顏色"                                    LabelAlign="Right" LabelWidth="70" DisplayField="name" ValueField="value" Mode="Local"                                    TriggerAction="All" EmptyText="請設定顏色" StoreID="Store1" SelectedIndex="0">                                    <Template ID="Template1" runat="server">                                        <Html>                                            <tpl for=".">                        <div class="x-combo-list-item icon-combo-item " style="background:{iconCls};color:#fff;">                            {name}                        </div>                    </tpl>                                        </Html>                                    </Template>                                </ext:ComboBox>                            </ext:Cell>                            <ext:Cell>                                <ext:DateField LabelAlign="Right" ID="startdate" LabelWidth="70" Width="250" FieldLabel="開始時間"                                    runat="server">                                </ext:DateField>                            </ext:Cell>                            <ext:Cell>                                <ext:DateField LabelAlign="Right" ID="enddate" LabelWidth="70" Width="250" FieldLabel="結束時間"                                    runat="server">                                </ext:DateField>                            </ext:Cell>                            <ext:Cell ColSpan="2">                                <ext:TextField Width="500" LabelAlign="Right" LabelWidth="70" ID="txtBiaoTi" runat="server"                                    FieldLabel="日程標題" AllowBlank="false" BlankText="日程標題必須填寫">                                </ext:TextField>                            </ext:Cell>                            <ext:Cell ColSpan="2">                                <ext:Panel LabelAlign="Right" ID="Panel2" LabelWidth="70" FieldLabel="日程內容" runat="server"                                    Border="false" Width="500">                                    <Content>                                        <textarea id="txtBeiZhu" runat="server" class="txtArr"></textarea>                                        <ext:TextField ID="txtBeiZhuH" Hidden="true" runat="server" />                                    </Content>                                </ext:Panel>                            </ext:Cell>                            <ext:Cell ColSpan="2">                                <ext:TextField ID="hideid" Text=""