EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: battlezad on September 03, 2016, 10:32:54 AM



Title: DnD School timetable; move
Post by: battlezad on September 03, 2016, 10:32:54 AM
I'm desperately trying to make something based on DnD School timetable example http://jeasyui.com/tutorial/dd/dnd3.php

How to define that object is moved to table? So you can move for example "Music" only once to table? And you can remove it back to list.

Thanks beforehand.


Title: Re: DnD School timetable; move
Post by: stworthy on September 04, 2016, 08:00:02 AM
Please try this code instead.
Code:
onDrop:function(e,source){
$(this).removeClass('over');
if ($(source).hasClass('assigned')){
$(this).append(source);
} else {
var t = $(source).text();
if ($('.right').find('.item:contains('+t+')').length){
return;
}
var c = $(source).clone().addClass('assigned');
$(this).empty().append(c);
c.draggable({
revert:true
});
}
}


Title: Re: DnD School timetable; move
Post by: battlezad on September 06, 2016, 04:44:28 AM
I made it a bit differently.. http://tulospalvelu.biz/santa/

Idea is to store those lineups to mysql db. Now the problem is how to fill that table when page is loaded/refreshed?
How to define for example box "#5 Panu Kauppi" is in first box in first line etc.


Title: Re: DnD School timetable; move
Post by: stworthy on September 06, 2016, 07:29:43 PM
Please look at this example http://code.reloado.com/akojag3/edit#preview


Title: Re: DnD School timetable; move
Post by: battlezad on September 06, 2016, 10:40:01 PM
Thank you, I'll look into this.


Title: Re: DnD School timetable; move
Post by: battlezad on September 07, 2016, 02:08:22 AM
I managed to go this far: http://tulospalvelu.biz/santa/index.php

It reads player list from db and makes some assigns. But now left table items are not draggable. How to do this right?

update: I moved $('.left .item').draggable inside $.post call and now it works.