2011-12-06 2 views
1

私のプロジェクトでは、RadSchedulerを使用しています。Telerik&Jquery

ニーズの結果、カスタム編集「ウィンドウ」を作成する必要がありました。

<telerik:RadScheduler runat="server" ID="radScheduler" SelectedView="TimelineView" 
       EnableExactTimeRendering="True" DayStartTime="00:00:00" DayEndTime="23:59:59" 
       DataKeyField="ID" DataSubjectField="Subject" DataStartField="Start" DataEndField="End" 
       DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentId" 
       AllowInsert="false" AllowDelete="False" AllowEdit="false" ColumnWidth="100px" 
       OnAppointmentCreated="radScheduler_AppointmentCreated" AdvancedForm-Modal="true" 
       Width="100%" FirstDayOfWeek="Monday" ShowHoursColumn="False" Skin="Telerik" ShowsConfirmationWindowOnDelete="False" 
       OnFormCreated="radScheduler_FormCreated"> 
       <TimelineView UserSelectable="true" GroupingDirection="Vertical" NumberOfSlots="24" 
        ColumnHeaderDateFormat="HH:mm" ShowInsertArea="false" StartTime="00:00:00" SlotDuration="01:00:00" 
        GroupBy="Room" /> 
       <DayView UserSelectable="false" /> 
       <MonthView UserSelectable="false" /> 
       <WeekView UserSelectable="false" /> 
       <AdvancedEditTemplate> 
        <scheduler:AdvancedForm runat="server" ID="AdvancedInsertForm1" Mode="Edit"/> 
       </AdvancedEditTemplate> 
      </telerik:RadScheduler> 

ともRadAjaxManager:私はメインページでは基本的に

。 AdvancedForm.ascxでAdvancedForm.ascx

<scheduler:AdvancedForm>ポイント私が持っている問題は、$(ドキュメント).readyが呼び出されないことであるjavascriptのブロック

<script type="text/javascript"> 

    var chart; // global 

    /* 
    * Request data from the server, add it to the graph 
    */ 
    function requestData() { 
     $.ajaxSetup({ cache: false }); 
     $.getJSON('exampleurl', function (data) { 

      //Clear the "old" series 
      while (chart.series.length > 0) { 
       chart.series[0].remove(true); 
      } 

      //declare Json 
      var jsonObj = { 
       series: [] 
      }; 

      //Cycle through each JSONobjcect returned by the url 
      $.each(data, function (i, item) { 
       var key = item['tag']; 
       var value = item['data']['Velocity']; 

       jsonObj.series.push({ 
        "name": key, 
        "data": value 
       }); 
      }); 

      //Add each of the key:value pair to the series 
      for (var i in jsonObj.series) { 
       chart.addSeries(jsonObj.series[i]); 
      } 

      // call it again after ten seconds 
      setTimeout(requestData, 10000); 
     }); 
    } 

    $(document).ready(function() { 
     chart = new Highcharts.Chart({ 
      chart: { 
       renderTo: 'container', 
       defaultSeriesType: 'column', 
       events: { 
        load: requestData 
       } 
      }, 
      title: { 
       text: 'Test Chart' 
      }, 
      xAxis: { 
       title: { 
        text: 'Viaturas' 
       }, 
       categories: [''] 
      }, 
      yAxis: { 
       min: 0, 
       title: { 
        text: 'Velocidade (Km/h)' 
       } 
      }, 
      tooltip: { 
       formatter: function() { 
        return '' + 
         this.series.name + ': ' + this.y + ' Km/h'; 
       } 
      }, 
     }); 
    }); 

これを持っています...

ありがとうございました。

+0

JavaScriptエラーが表示されますか? – jrummell

答えて

0

に変更してみてください:

$(function(){ 
+0

何も起きません... –

+0

先頭にアラートを追加しましたか?あなたのコードは実際には何もしませんが、いくつかの追加コードを見ることなくチャートオブジェクトをインスタンス化する以外は何もしないようです。 JSエラーもチェックしてください。 – methodin

+0

私は持っています。それはまさにそれを行うと思われますが、グラフは表示されません...私はチェックした、それはエラーを与えません.. –

関連する問題