###jq.schedule.jsでクリック行を取得する方法
jq.schedule.jsを使ってスケジュールアプリを作っています。
https://github.com/ateliee/jquery.schedule
スケジュールの空白部分をクリックした時の行番号(またそのタイトル)を取得したいのですが、どのようにすればよいのでしょう?
よろしくお願いいたします。
###該当のソースコード
<script type="text/javascript"> jQuery(document).ready(function(){ var $sc = jQuery("#schedule").timeSchedule({ startTime: "07:00", // schedule start time(HH:ii) endTime: "21:00", // schedule end time(HH:ii) widthTime:60 * 30, // cell timestamp example 10 minutes timeLineY:60, // height(px) verticalScrollbar:20, // scrollbar (px) timeLineBorder:2, // border(top and bottom) debug:"#debug", // debug string output elements rows : { '1' : { title : 'テスト1', schedule:[ { start:'09:00', end:'12:00', text:'Text Area', data:{ } }, { start:'15:00', end:'18:00', text:'Text Area', data:{ } } ] }, '2' : { title : 'テスト2', schedule:[ { start:'16:00', end:'17:00', text:'Text Area', data:{ } } ] }, '3' : { title : 'テストC', schedule:[ { start:'10:00', end:'20:00', text:'Text Area', data:{ } } ] }, '4' : { title : 'テストD', schedule:[ { start:'10:00', end:'16:00', text:'Text Area', data:{ } } ] } }, change: function(node,data){ alert("change event"); }, init_data: function(node,data){ }, click: function(node,data){ alert("click event"); }, append: function(node,data){ }, time_click: function(time,data){ //選択列を取得 alert($(time).index()); //ここに選択行を取得したい。 }, }); }); </script>
###試したこと
time_click: function(time,data){
//選択列を取得
alert($(time).index());
},
index()で、列数は取得できています。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。