Hi all,
I'm working on a project where I need to schedule persons in rooms. I'm using jQuery sortables to achieve this task. The only 'problem' is that there is a maximum capacity for a room. E.g. some rooms can have max. 3 persons, others 4 and some maybe only 1. So after browsing the jQuery documentation I came up with this.. only, it's not doing anything. The part between onStart: function(){}
is created dynamicly by PHP.
Do you guys have some experience in setting up a max no. of items in a sortable list and check for that?
$(function() {
$(".sortable, .connectable").sortable({
connectWith: '.sortable, .connectable',
helper: 'clone',
cursor: 'move',
onStart: function()
{
if($(".room-1-1").sortable('items') == 2)
{
alert("Maximum reached..");
}
if($(".room-1-2").sortable('items') == 2)
{
alert("Maximum reached..");
}
}
}).disableSelection();
});