2011-01-14 4 views
0

私は自分のイベントを表示するためにExt.NET asp.netカレンダーコントロールを設定しようとしましたが、どうやってそれを行うのか分かりません。また、Ext.NETイベントクラスは独自のフィールドを持っていますが、カレンダーコントロールで表示するために自分のフィールドを配置する必要があります。 例: leaveId、leavetype、leaveReason、from、ToなどExt.NETカレンダーコントロールを設定するにはどうすればよいですか?

どうすればこの問題を解決できますか? ext.netフレームワークの専門家は返信してください。

答えて

1

Ext.NETカレンダーの設定は簡単ですが、カレンダーは、Extで提供されているEventCollectionオブジェクトにラップされたイベントを与えた場合にのみ機能します。

以下は、カレンダーのイベントを返すWebサービスメソッドの例です。

<ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Gray" /> 
<ext:Viewport ID="Viewport1" runat="server" Layout="Border"> 
    <Items> 
     <ext:Panel runat="server" Width="176" Region="West" Border="false"> 
      <Items> 
       <ext:DatePicker ID="dtpCurrentDate" runat="server"> 
        <Listeners> 
         <Select Fn="setStartDate" /> 
         <BeforeRender Handler="this.showPrevMonth = this.showPrevMonth.createSequence(HighlightPostDates);this.showNextMonth = this.showNextMonth.createSequence(HighlightPostDates);this.onMonthClick = this.onMonthClick.createSequence(HighlightPostDates);" /> 
        </Listeners> 
       </ext:DatePicker> 
      </Items> 
     </ext:Panel> 
     <ext:CalendarPanel runat="server" ID="pnlCalendar" Region="Center" > 
     <MonthView runat="server"></MonthView> 
     <WeekView runat="server"></WeekView> 
     <DayView runat="server"></DayView> 
      <GroupStore runat="server" ID="storeGroups"> 
       <Groups> 
        <ext:Group CalendarId="1" Title="Event Type 1" /> 
        <ext:Group CalendarId="2" Title="Event Type 2" /> 
       </Groups> 
      </GroupStore> 
      <EventStore ID="EventStore1" runat="server" DateFormat="M$" ShowWarningOnFailure="false"> 
       <Proxy> 
        <ext:HttpProxy Json="true" /> 
       </Proxy> 
       <Reader> 
        <ext:JsonReader Root="d" /> 
       </Reader> 
       <BaseParams> 
        <ext:Parameter Name="start" Value="" Mode="Value" /> 
        <ext:Parameter Name="end" Value="" Mode="Value" /> 
       </BaseParams> 
       <Listeners> 
        <Load Fn="HighlightPostDates" /> 
       </Listeners> 
      </EventStore> 
     </ext:CalendarPanel> 
    </Items> 
</ext:Viewport> 

そして、あなたの背後にあるコードで実行して、両方を接続します:

((HttpProxy)this.pnlCalendar.EventStore.Proxy.Proxy).Url = "Method URL..."; 
      ((HttpProxy)this.pnlCalendar.EventStore.Proxy.Proxy).Method = HttpMethod.POST; 
あなたはこのような何かを必要とするページで

[WebMethod] 
public EventCollection GetEvents(DateTime start, DateTime end) 
    { 
     EventCollection results = new EventCollection(); 
     //....Fill the collection here..... 
     return results; 
    }