我只是想确保我现在走在正确的轨道上:
做了一件小事,让管理员可以编辑人们的日程安排。现在他点击一行,所有的时间表都变成了可编辑的。如果他连续更改值,我会抓住它
$('.selector').change(function() { // this happens to be a <select> dropdown. I guess technically this is the <option> inside of the select.
var updates = new Array(); // an array of all the updates
var classList = $(this).attr('id').split(/\s+\); // the id of a <select> would be something like "12 monday start" meaning the user_id, day_of_week, start/end time. Just converting it to an array here.
classList.push($(this).val()); // the time it has been changed to
updates.push(classList); // add the singular time update to the overall array
$('.save_schedule').click(function() {
// here I would iterate through all of the arrays in updates and do some sort of ajax call, correct?
});
});
只是想确保在我走得更远之前我走在正确的轨道上,并且可能会重写一些东西。
谢谢
我的 HTML 已被请求:https ://gist.github.com/2435293