EasyUI Forum
May 21, 2024, 01:01:58 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: DnD School timetable; move  (Read 6838 times)
battlezad
Newbie
*
Posts: 44


View Profile
« 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.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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
});
}
}
Logged
battlezad
Newbie
*
Posts: 44


View Profile
« Reply #2 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.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: September 06, 2016, 07:29:43 PM »

Please look at this example http://code.reloado.com/akojag3/edit#preview
Logged
battlezad
Newbie
*
Posts: 44


View Profile
« Reply #4 on: September 06, 2016, 10:40:01 PM »

Thank you, I'll look into this.
Logged
battlezad
Newbie
*
Posts: 44


View Profile
« Reply #5 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.

« Last Edit: September 07, 2016, 02:26:12 AM by battlezad » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!