Welcome, Guest. Please login or register.
Did you miss your activation email?
Oct. 11, 2008, 10:26:50 AM
47669 Posts in 10453 Topics by 5339 Members
Latest Member: phamlehoaian
News: PRADO 3.1.1 is released!
 
The PRADO Community » Prado v3.x » Component Repository » Drag and drop components « previous next »
Pages: [1] 2 Print
Author Topic: Drag and drop components  (Read 2451 times)
tof06
PRADO v3.x Developer
Platinum Member
*****

Karma: 66
Offline Offline

Posts: 733



View Profile
« on: Feb. 29, 2008, 05:31:19 PM »

Hello all,

For thoses who are interested, I've ported Prado V2 Drag&Drop components to prado V3.
I publish them here for now, maybe I will integrate them in the Framework as soon as they are well tested and documented.

Meanwhile, you will find in the attached file a demo (pretty the same than the Scriptaculous demo), and the two components in the protected/common folder : CDropContainer and CDraggable.

Quick doc :
Requirements : Prado 3.1.2a (or at least, trunk rev 2351+ because of a bug in previous TJavascript version)

CDropContainer is an ActivePanel where you can drop CDraggable controls. It will raise the onDrop event, with a CDropContainerEventParameter as $param, which contains the dropped control.
CDraggable is just a TPanel, which can be dragged.
The properties for both component are pretty the same than Prado V2 components, I let you discover them in the source. Sorry, I don't have time to make docs Wink

Please, test theses component if you are interested, and make some feedback here.

Cheers,

Christophe

EDIT: Some problems with IE... I'll try to fix them asap. Stay tuned Wink
EDIT 03/04/2008 : IE Problem fixed. Component also shared on Component Repository
« Last Edit: Mar. 05, 2008, 10:12:33 PM by tof06 » Logged
rojaro
Senior Member
***

Karma: 22
Offline Offline

Posts: 422


PRADO aint no voodoo ...


View Profile WWW
« Reply #1 on: Feb. 29, 2008, 06:04:35 PM »

You rock Grin

Greetings from Hamburg / Germany
- rojaro -
Logged

A mathematician is a machine for turning coffee into theorems. ~ Alfred Renyi (*1921 - †1970)
daneel
Junior Member
**

Karma: 17
Offline Offline

Posts: 41



View Profile WWW
« Reply #2 on: Feb. 29, 2008, 09:42:51 PM »

well, I have done the same controls like a month ago or so, but I forgot to post them here  Undecided

anyway, I'm sure yours are better Tongue

I think you should integrate them to prado... I'm feeling that PRADO lacks of more user interface controls...

so, great !
Logged

Syberia - Web Applications - www.syberia-la.com
rabol
Senior Member
***

Karma: 6
Offline Offline

Posts: 200



View Profile WWW
« Reply #3 on: Mar. 01, 2008, 12:50:01 AM »

could you post your code/version - it might help as the tof06's version don't work if you use IE
Logged

Creator of Prado Portal - www.pradoportal.dk
tof06
PRADO v3.x Developer
Platinum Member
*****

Karma: 66
Offline Offline

Posts: 733



View Profile
« Reply #4 on: Mar. 01, 2008, 11:14:04 AM »

I don't understand the IE problem Sad
It seems something is missing after the callback is made. If I remove the callback, replacing it by a javascript alert, there's no problem.
If a JS expert has an idea, feel free to help me !
Logged
rabol
Senior Member
***

Karma: 6
Offline Offline

Posts: 200



View Profile WWW
« Reply #5 on: Mar. 01, 2008, 11:34:24 AM »

I would love to help but I don't have a clue in the JS part - That's why I suggested daneel  to upload his version.

I'll try later this weekend to get some JS knowledge and see if I can contribute in any way as I would love to have this control Smiley
Logged

Creator of Prado Portal - www.pradoportal.dk
rabol
Senior Member
***

Karma: 6
Offline Offline

Posts: 200



View Profile WWW
« Reply #6 on: Mar. 01, 2008, 12:03:10 PM »

I'm not 100% sure, but it could look like it's a 'bug' in the prototype.js - which is a RC version an ~1 year old.

I'll try to upgrade an see what happens
Logged

Creator of Prado Portal - www.pradoportal.dk
tof06
PRADO v3.x Developer
Platinum Member
*****

Karma: 66
Offline Offline

Posts: 733



View Profile
« Reply #7 on: Mar. 02, 2008, 12:36:11 PM »

Ok, I've found where the problem is. But now, I need to find a solution !

My CDropContainer is an extension of TActivePanel, this way, I can update its content on callback.
But because of this, the js script is also re-rerendered, and a new Droppable (in scriptaculous) is registered. It doesn't seem to bother FF, but IE don't like it...
This is also bad, because with many callbacks, it would eat client memory by registering a new droppable each time !
I need to find a way to update the content of the dropcontainer, but not render the js.
Logged
tof06
PRADO v3.x Developer
Platinum Member
*****

Karma: 66
Offline Offline

Posts: 733



View Profile
« Reply #8 on: Mar. 04, 2008, 04:08:45 PM »

IE Problem fixed. See the first post for an updated version

I think I will make this component also available in component repository.

Changes : The CDropContainer is not a TActivePanel anymore. Instead, it creates a subpanel (active, to be able to update it on callback) where childs controls goes.
If you call CDropContainer::render inside a callback, only the subpanel will be updated.

Cheers.
Logged
rojaro
Senior Member
***

Karma: 22
Offline Offline

Posts: 422


PRADO aint no voodoo ...


View Profile WWW
« Reply #9 on: Mar. 04, 2008, 04:30:23 PM »

Really nice work tof06,

with a little bit of polishing this component belongs in Prados trunk, but not the component repository. This is something i am sure many people have been waiting for for quite some time now (i know, i have). Karma++

Greetings from Hamburg / Germany
- rojaro -
Logged

A mathematician is a machine for turning coffee into theorems. ~ Alfred Renyi (*1921 - †1970)
tof06
PRADO v3.x Developer
Platinum Member
*****

Karma: 66
Offline Offline

Posts: 733



View Profile
« Reply #10 on: Mar. 04, 2008, 04:34:37 PM »


with a little bit of polishing this component belongs in Prados trunk, but not the component repository. This is something i am sure many people have been waiting for for quite some time now (i know, i have). Karma++


I know. It will take place in Prado trunk as soon as I will have enough reviews and test for it, and when doc (phpdoc and qst) will be written.
The advantage of Component Repository is that more users have (or can have) write access on it, and therefore, can update the component by themselve.
Once everything seems ok, I can merge the component branch into the trunk, replacing C by T Wink

Components shared here
Logged
Zen
Senior Member
***

Karma: 7
Offline Offline

Posts: 221



View Profile WWW
« Reply #11 on: Mar. 04, 2008, 07:15:30 PM »

Hi I've just tried these controls from the trac source and no callbacks are initiated. When i check the log console, nothing happens at all  Sad

I am using the latest Prado

Zen
Logged

tof06
PRADO v3.x Developer
Platinum Member
*****

Karma: 66
Offline Offline

Posts: 733



View Profile
« Reply #12 on: Mar. 05, 2008, 08:46:00 AM »

Very strange. What is your error_reporting level ? Try to put it to E_ALL if it's not already, or even to E_ALL | E_STRICT to show notices.
Logged
Zen
Senior Member
***

Karma: 7
Offline Offline

Posts: 221



View Profile WWW
« Reply #13 on: Mar. 05, 2008, 02:39:32 PM »

Yeah that is what I thought, it doesnt even throw an exception or anything. I have full error reporting on the clientsdie switched on (as in DisplayErrors=On) and also have them logged to a file. Yet not a single sausage, firebug doesnt even give an error of any kind either, I've checked the HTML generated and it is putting the right control names in the right places etc. I am going to update Prado today and see if that does anything.

I will let you know if I find something.

Zen
Logged

ctrlaltca
Junior Member
**

Karma: 1
Offline Offline

Posts: 27



View Profile
« Reply #14 on: Mar. 05, 2008, 07:12:44 PM »

Same problem here: no callback, no error, nothing at all. More precisely:
  • the mug and the t-shirt gets the right mouse cursor, the ability to be dragged around the screen (partial opacity too);
  • if you move them over the "your shopping cart" div, you don't the orange div background as in scriptaculous demo;
  • if you drop them over the "your shopping cart" div, you don't get nothing (no callback, no error).
Sounds like some javascript doesn't work... i'll investigate Smiley
Logged
Pages: [1] 2 Print 
« previous next »
Jump to: