0
あなたはうまくいけばいいですか?YUI SchedulerEventRecorderポップアップ
ビルドする必要があるのは、ユーザーがカレンダーを介して自分の空き状況を提供し、それをdbに保存できるカレンダーです。 私はSchedulerEventRecorderで遊んでいます。 テキストボックスを選択リストに置き換えて、ユーザがオプション(利用不可能、利用可能、x、y)に制限されるように、イベントを追加するときにポップアップに微調整したい、z)。
私は自分の脳を傷つけていて、ドキュメントを理解しようとしており、これについてどうやって行くのか分かりません。どんなヒントも訴えられるだろう。
私のコードは、これまでのところです(PHPコード言い訳):
<script>
YUI().use(
'aui-scheduler',
function(Y)
{
<?php if($availability_count > 0) { ?>
var events = [
<?php
foreach($availability as $a)
{
?>
{
color: '<?php echo $cb->Get_booking_status_colour($a['booking_status'])?>',
borderColor: '<?php echo $cb->Get_booking_status_colour($a['booking_status'])?>',
content: '<?php echo $cb->Get_booking_status_name($a['booking_status'])?>',
endDate: new Date(<?php echo format_date($a['date_end'], 'Y')?>, <?php echo date('m', strtotime($a['date_end']. '-1 month'))?>, <?php echo format_date($a['date_end'], 'd')?>),
startDate: new Date(<?php echo format_date($a['date_start'], 'Y')?>, <?php echo date('m', strtotime($a['date_start']. '-1 month'))?>, <?php echo format_date($a['date_start'], 'd')?>)
},
<?php
}
?>
];
<?php } ?>
var monthView = new Y.SchedulerMonthView({ isoTime: true });
var eventRecorder = new Y.SchedulerEventRecorder({
on: {
save: function(event) {
alert('Save Event:' + this.isNew() + ' --- ' + this.getContentNode().val() + ' --- ' + this.getClearStartDate() + ' --- ' + this.getClearEndDate());
console.log(this.serializeForm());
},
edit: function(event) {
alert('Edit Event:' + this.isNew() + ' --- ' + this.getContentNode().val() + ' --- ' + this.getClearStartDate() + ' --- ' + this.getClearEndDate());
console.log(this.serializeForm());
},
delete: function(event) {
alert('Delete Event:' + this.isNew() + ' --- ' + this.getContentNode().val() + ' --- ' + this.getClearStartDate() + ' --- ' + this.getClearEndDate());
console.log(this.serializeForm());
}
},
dateFormat: '%a, %B %d, %Y',
content: '',
repeated: true
});
eventRecorder.setTitle('test');
eventRecorder.setContent('test 2');
new Y.Scheduler(
{
activeView: monthView,
boundingBox: '#myScheduler',
date: new Date(<?php echo date('Y')?>, <?php echo date('m', strtotime('-1 month'))?>, <?php echo date('d')?>),
eventRecorder: eventRecorder,
items: events,
render: true,
views: [monthView]
}
);
}
);
</script>
おかげ
ラジを