【发布时间】:2020-03-03 14:17:01
【问题描述】:
我正在制作一个显示来自后端的数据的滑块。使用“推送”功能,它会根据日期在滑块中显示幻灯片。但我需要它根据日期和状态显示这些幻灯片。
先显示未完成状态(btn-danger),后显示待处理状态(btn-success),然后显示完成状态(btn-warning)。
完整代码:
paste.ofcode.org/hmKSwTvaWrjTj3A6rWh464
代码:
function handleSubmit(command) {
if(command === 'meeting') {
let meetingFormValue = getMeetingFormValue('.create-meeting-form');
httpService.post('http://localhost:3000/meeting/create', meetingFormValue)
.then(response => {
meetings.push(response);
setMeetingCarausel();
}).catch(ex => {
console.log('Error');
console.log(ex);
})
// close the form
$('.create-meeting-form').stop().slideToggle();
}else if(command === 'task') {
//attendees
const taskFormValue = getTaskFormValue('#createTaskForm');
httpService.post('http://localhost:3000/meeting/taskList/create', taskFormValue)
.then(response => {
tasks.push(response);
setTasksCarausel();
}).catch(ex => {
console.log(ex);
});
// close the form
$('.create-task-form').stop().slideToggle();
}
}
【问题讨论】:
-
数据在哪里?
-
@ksav 数据来自数据库并显示在滑块 ibb.co/5KJpdrh 的幻灯片中,它包含主题、日期、状态
-
将数据添加到您的问题中。
-
我添加了视图截图和完整代码
-
没有数据。您不想对数据进行排序吗?
标签: javascript jquery ejs