Ext.net日历数据绑定

时间:2015-01-23 14:10:59

标签: calendar ext.net

第一次使用ext.net日历表单。我在sql数据库中有日期。 我尝试动态地将calendarpanel与eventstore绑定。但是来到空白日历。

*** Public Sub Calendar_Fill()         Sql =“选择不同的[SrvSchDate],[SrvWave],[SrvMvGrp]来自Migrate_info,其中[SrvSchDate]> CURRENT_TIMESTAMP group by [SrvSchDate],[SrvWave],[SrvMvGrp]”         的GetData(SQL)         Dim oEvents = New Ext.Net.EventCollection         Dim oEvtStore =新的Ext.Net.EventStore         Dim oEvt作为Ext.Net.Event

    Dim j As Integer = 0

    For Each row As DataRow In ds.Tables(0).Rows
        oEvt = New Ext.Net.Event
        oEvt.CalendarId = j
        oEvt.EventId = j
        oEvt.EndDate = ds.Tables(0).Rows(j).Item(0)
        oEvt.StartDate = ds.Tables(0).Rows(j).Item(0)
        oEvt.Title = ds.Tables(0).Rows(j).Item(1) + " " + ds.Tables(0).Rows(j).Item(2)
        j = j + 1
        oEvents.Add(oEvt)
    Next


    oEvtStore.Events.AddRange(oEvents)


    myCalendar.EventStore = oEvtStore

End Sub`

1 个答案:

答案 0 :(得分:0)

***客户端                                                                                                                 

                            </Groups>
                        </GroupStore>
                        <MonthView ID="MonthView1" 
                            runat="server" 
                            ShowHeader="true" 
                            ShowWeekLinks="true" 
                            ShowWeekNumbers="true" 
                            /> 
                    </ext:CalendarPanel>

**服务器端**  Public Sub Calendar_Fill()         Sql =“选择不同的[SrvSchDate],[SrvWave],[SrvMvGrp]来自Migrate_info,其中[SrvSchDate]&gt; CURRENT_TIMESTAMP group by [SrvSchDate],[SrvWave],[SrvMvGrp]”         的GetData(SQL)         Dim oEvents = New Ext.Net.EventCollection         Dim oEvtStore =新的Ext.Net.EventStore         Dim oEvt作为Ext.Net.Event

    Dim j As Integer = 0

    For Each row As DataRow In ds.Tables(0).Rows
        oEvt = New Ext.Net.Event
        oEvt.CalendarId = j
        oEvt.EventId = j
        oEvt.EndDate = CDate(ds.Tables(0).Rows(j).Item(0))
        oEvt.StartDate = CDate(ds.Tables(0).Rows(j).Item(0))
        oEvt.Title = ds.Tables(0).Rows(j).Item(1) + " " + ds.Tables(0).Rows(j).Item(2)
        j = j + 1
        oEvents.Add(oEvt)
    Next


    oEvtStore.Events.AddRange(oEvents)


    myCalendar.EventStore = oEvtStore

End Sub