0
我正在嘗試修改codeigniter日曆以便爲每個單元格分別添加按鈕。當彈出的添加按鈕彈出時會顯示自動填充的特定日期彈出。爲此,當我點擊添加按鈕時,我想獲取選定的日期。codeigniter日曆:如何獲取所選日期?
我的日曆是這樣的。
我用下面的模型函數來創建日曆
function mycal_model() {
$this->conf = array(
'show_next_prev' => True,
'next_prev_url' => base_url() . 'index.php/dashboard/index/'
);
$this->conf['template'] = '
{table_open}<table cellpadding="1" cellspacing="2" class="calendar">{/table_open}
{heading_row_start}<tr>{/heading_row_start}
{heading_previous_cell}<th class="prev_sign"><a href="{previous_url}"><<</a></th>{/heading_previous_cell}
{heading_title_cell}<th colspan="{colspan}">{heading}</th>{/heading_title_cell}
{heading_next_cell}<th class="next_sign"><a href="{next_url}">>></a></th>{/heading_next_cell}
{heading_row_end}</tr>{/heading_row_end}
//Deciding where to week row start
{week_row_start}<tr class="week_name" >{/week_row_start}
//Deciding week day cell and week days
{week_day_cell}<td >{week_day}</td>{/week_day_cell}
//week row end
{week_row_end}</tr>{/week_row_end}
{cal_row_start}<tr class= "days">{/cal_row_start}
{cal_cell_start}<td>{/cal_cell_start}
{cal_cell_content}
<div class="day_num">{day}<button type="button" class="add_btn">+</button>
</div>
<div class="content" style="width:50%; height:40px;">{content}
</div>
{/cal_cell_content}
{cal_cell_content_today}
<div class="day_num highlight">{day}<button type="button" class="add_btn">+</button>
</div>
<div class= "content">{content}</div>
{/cal_cell_content_today}
{cal_cell_no_content}<div class="day_num">{day}<button type="button" class="add_btn">+</button>
</div>
<div class="content1" style="width:50%; height:35px; display:block; float:left; background-color:#95FF95; text-align:center; vertical-align:middle; "><a href="#">+</a>
</div>
<div class="content2" style="width:50%; height:35px; display:block; float:left; background-color:#95FF95; text-align:center; vertical-align:middle; "><a href="#">+</a>
</div>
<div class="content3" style="width:50%; height:35px; display:block; float:left; background-color:#95FF95; text-align:center; vertical-align:middle; "><a href="#">+</a>
</div>
<div class="content4" style="width:50%; height:35px; display:block; float:left;; background-color:#95FF95; text-align:center; vertical-align:middle; "><a href="#">+</a>
</div>
{/cal_cell_no_content}
{cal_cell_no_content_today}<div class="day_num highlight">{day}<button type="button" class="add_btn">+</button>
</div>
<div class="content1" style="width:50%; height:35px; display:block; float:left; background-color:#95FF95; text-align:center; vertical-align:middle; "><a href="#">+</a>
</div>
<div class="content2" style="width:50%; height:35px; display:block; float:left; background-color:#95FF95; text-align:center; vertical-align:middle; "><a href="#">+</a>
</div>
<div class="content3" style="width:50%; height:35px; display:block; float:left; background-color:#95FF95; text-align:center; vertical-align:middle; "><a href="#">+</a>
</div>
<div class="content4" style="width:50%; height:35px; display:block; float:left;; background-color:#95FF95; text-align:center; vertical-align:middle; "><a href="#">+</a>
</div>{/cal_cell_no_content_today}
{cal_cell_blank} {/cal_cell_blank}
{cal_cell_end}</td>{/cal_cell_end}
{cal_row_end}</tr>{/cal_row_end}
{table_close}</table>{/table_close}
';
}
我爲添加按鈕按鈕點擊事件下面的腳本。但我可以只顯示彈出up.i不知道如何得到選定的日期。
$(".calendar .days td .add_btn").click(function() {
$('#events_add_modal').modal('show');
});
如果有人有一個想法,這將是一個很大的幫助。
你試過這個..嗎? http://fullcalendar.io/ –
@NithinKrishnanP是的。我早些時候嘗試過。但是在那個日曆中,我們不能將一個單元劃分爲四個部分。我想這分成四個部分。這是要求。這就是爲什麼我用這個而不是完整的日曆。 – Stell