Welcome, Guest. Please login or register.
Did you miss your activation email?
February 12, 2012, 04:32:57 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
149621 Posts in 21098 Topics by 7537 Members
Latest Member: lotte2
* Home Help Search Login Register
Pages: [1] 2   Go Down
Print
Author Topic: drag & drop for other modules  (Read 1581 times)
Olli

Offline Offline

Posts: 288


« on: January 27, 2010, 11:49:34 PM »

hello,

i like the drag & drop feature for sorting pages inside the latest WebsiteBaker very much.
i would like to include this feature into my own modules aswell. i looked though the forum, but i was not able to find any useful information on this.
i looked into the WB code, but for some reason i could not get it to work. i suppose i forgot something...

has anybody included this into their own module already? what is needed to be done for this? can you help me out?

thanks a lot
« Last Edit: January 29, 2010, 12:49:38 AM by Olli » Logged
chio
WebsiteBaker Org e.V.

Offline Offline

Posts: 2264


« Reply #1 on: January 28, 2010, 08:34:01 AM »

There are lots of request for this feature.
The module MPForm has Drag&Drop.

I wished, someone writes a "How to", to implement Drag&Drop easy to any module.
Logged

*weg*
Olli

Offline Offline

Posts: 288


« Reply #2 on: January 28, 2010, 04:26:50 PM »

hey chio,

thanks for pointing me to that module. will implement it into my module the next days and tell you how.

thanks
Logged
Stefek
WebsiteBaker Org e.V.

Offline Offline

Posts: 4753



« Reply #3 on: January 28, 2010, 07:39:49 PM »

Hello Olli, Hello Chio,
there is another Module which uses this technique.

so see here for another example:
http://www.websitebaker2.org/forum/index.php/topic,14982.0.html

I hope this helps.

I'm also interested in a implementation how to wink

Kind Regards,
Stefek
Logged

"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Waldschwein
Guest
« Reply #4 on: January 28, 2010, 08:17:32 PM »

Hello!

Well, the best would be a module that uses jQuery1.4 for drag&drop and a tutorial that explains how to move from YUI drag&drop to jQuery. That would even help the Core Developer.  wink I doubt in future releases beyond 2.8.1 YUI would be included by default...

Yours Michael



Logged
Olli

Offline Offline

Posts: 288


« Reply #5 on: January 29, 2010, 12:48:14 AM »

hello waldschwein,

so jQuery is the way to go you say?

i think this is what i need for this then i guess...
http://www.isocra.com/2008/02/table-drag-and-drop-jquery-plugin/

but how to i put the new sorting-order to the database? i have never written any ajax requests on my own yet...
but will look closer to this the next days and will post the final result with turorial steps here.

thanks
Logged
doc
Guest
« Reply #6 on: January 29, 2010, 08:00:23 AM »

Hallo Olli,

mit dem Plugin habe ich vor gut 1.5 Jahren mal ein Kundenmodul gebaut, um Drag & Drop von Einträgen zu im Backend zu ermöglichen. Wenn Du mit jQuery und Ajax ins straucheln geraden solltest, kannst Du ja mal nen Blick ins "Post-Its" Modul werfen. Dort werden einige Ajax basierte Datenbankupdates mit der jQuery Ajax Schnittstelle und PHP/MySQL durchgeführt. Quellcode sollte gut genug kommentiert sein.

Schön zu sehen, dass jQuery langsam auch für UI verwendet wird und nicht nur für reine DOM Manipulation oder grafische Effekte bei Bildergallerien.

Doc
« Last Edit: January 29, 2010, 08:02:11 AM by doc » Logged
chio
WebsiteBaker Org e.V.

Offline Offline

Posts: 2264


« Reply #7 on: January 29, 2010, 08:41:39 AM »

Super, auf der Demo-Seite
http://www.isocra.com/2008/02/table-drag-and-drop-jquery-plugin/
steht sehr viel was man wissen muss.

Is there spme help how to integrate jquery into the backend - so that it works also if there are multiple sections?
Logged

*weg*
doc
Guest
« Reply #8 on: January 29, 2010, 12:56:52 PM »

Hi,

witzig. Den gleichen Link habe ich vor 1.5 Jahren gepostet wink
http://www.websitebaker2.org/forum/index.php/topic,3029.msg67257.html#msg67257

Gruss Doc
Logged
Olli

Offline Offline

Posts: 288


« Reply #9 on: January 29, 2010, 01:06:42 PM »

hey an alle smiley

danke für das feedback und die infos. ich melde mich, wenn ich fertig bin mit dem einbauen.

viele grüße
Logged
chio
WebsiteBaker Org e.V.

Offline Offline

Posts: 2264


« Reply #10 on: January 29, 2010, 01:08:57 PM »

Ja, aber wie nutzt man jQuery im Backend? Ich meine so, dass es sich nicht mit anderen Modulen schlägt, die ebenfalls jQuery nutzen.

AJAX ist ja an sich nicht so schwierig, da braucht man gar kein jQuery dazu. Aber man braucht etwas PHP, um die neue Sortierung wieder in die Datenbank zu übertragen.
Ich habe mir gerade die erweiterte order.class in MPForm angeschaut, da steige ich aber nicht recht durch..
Logged

*weg*
doc
Guest
« Reply #11 on: January 29, 2010, 01:16:41 PM »

Hi,

Quote
Ja, aber wie nutzt man jQuery im Backend? Ich meine so, dass es sich nicht mit anderen Modulen schlägt, die ebenfalls jQuery nutzen.
Versteh die Frage nicht ganz. Meinst Du die Einbindung oder von welchen Effekten sprichst Du? Wenn man in seinen Modulen $(document).ready(...) verwendet, sollten eigentlich keine Probleme entstehen.

Sind auch mehrere dieser Konstrukte pro Seite möglich, diese werden dann nacheinander abgehandelt. Zum sortieren einer Tabelle muss ja nur das DOM fertig sein, sprich Tabellenstruktur geladen, dann kann man die Drag & Drop Event Handler drauf loslassen. Hatte bisher noch keine Probleme mit den Modulen, welche dies verwendet haben.

Eventuell nochmal näher beschreiben, wenn ich was nicht verstanden haben sollte. Das PHP für das Datenbankupdate beim verschieben von Seiten im Seitenbaum wäre im WB Core bereits enthalten. Für Module müsste eine einheitliche Sortier ID etc. eingeführt werden (am besten wählbar). So könnte man ne API bauen, welche auch andere Module einfach nutzen können.

Doc
« Last Edit: January 29, 2010, 01:18:34 PM by doc » Logged
chio
WebsiteBaker Org e.V.

Offline Offline

Posts: 2264


« Reply #12 on: January 29, 2010, 01:33:46 PM »

Gibt es eigentlich Module, die jQuery im Backend nutzen? Da könnte ich ja schauen, wie das geht.

Anders gefragt: Gibt es sowas wie ein: "Tu das, dann das, - nein, das nicht! - aber dann das..."  Wink
Logged

*weg*
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1680



« Reply #13 on: January 29, 2010, 02:28:27 PM »

Hi,

the PM module from my signature use JQ for autosuggestion.. Im trying to keep up Tongue
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
doc
Guest
« Reply #14 on: January 29, 2010, 06:21:13 PM »

@Chio: Das "Post-its" Modul verwendet jQuery, wie bereits hier gepostet. Es nimmt aber nicht die jQuery Datei aus dem WB /include Ordner, sondern bringt ein eigenes mit. Wenn ich mich recht entsinne, war das Modul das erste, welches jQuery verwendet hat. Die Grundzüge sollten aber aus dem Modul klar werden.

Doc
Logged
chio
WebsiteBaker Org e.V.

Offline Offline

Posts: 2264


« Reply #15 on: January 30, 2010, 01:12:26 PM »

Ich meine: Gibt es einen "Standard", wie ein Modul jQuery im Backend nutzen kann, ohne sich mit anderen Modulen in die Haare zu geraten?

Das "eigene" jQuery mitnehmen; das geht ja in der modify.php eines Modules nicht, wenn andere Module das ebenfalls machen. Außerdem ist das ja nicht Sinn der Sache, dazu ist jQuery ja im Core.
Logged

*weg*
doc
Guest
« Reply #16 on: January 30, 2010, 01:38:50 PM »

Hi,

im Backend wird jQuery per Default eingebunden (WB 2.8.1 SVN) und steht somit auf Seiten in "modify.php" oder "tool.php" (Page/Admin tool) ohne weiteres zutun zur Verfügung. In die Quere kommt sich nichts, wenn alle jQuery Funktionen in document.ready gewrappt werden und es keine "mehrdeutigen" Funktionsnamen gibt.

Hat man weitere "Backend" Seiten wie z.B. ne "config.php", muss man sich um die Einbindung von jQuery selbst kümmern, genauso wie um die Absicherung dieser Seite vor unbefugtem Zugriff. In meinen Modulen erledige ich das mit einer "angepassten" admin Klasse, bzw. Funktion. Siehe z.B. AFE (functions.inc.php --> myAdminHandler). Über die Anpassung können CSS, JS Dateien eingebunden werden.

Im Frontend brauchts die register_frontend_m odfiles. Weiss nicht ob jQuery dann automatisch geladen wird. Falls nicht halt noch ne frontend.js oder frontend_body.js.

Doc
Logged
Luisehahne
Board Member
Development Team
*****
Offline Offline

Posts: 2949



WWW
« Reply #17 on: January 30, 2010, 01:57:59 PM »

Quote
Weiss nicht ob jQuery dann automatisch geladen wird.

Du brauchst nur statt js jquery eingeben, dann werden basis jquery scripte eingebunden, nur für die css musst du selber sorgen oder das modul.

Dietmar
Logged

We are human beings - and nobody is perfect at all.
chio
WebsiteBaker Org e.V.

Offline Offline

Posts: 2264


« Reply #18 on: January 30, 2010, 03:34:23 PM »

Euch muss man alles aus der Nase ziehen wink

Wäre mal schön ein Tutorial, wie das genau geht und was man so machen kann.
Logged

*weg*
doc
Guest
« Reply #19 on: January 30, 2010, 03:54:14 PM »

Hi,

Quote
Euch muss man alles aus der Nase ziehen
Naja Deine Anfragen bzw. "Antworten" auf Posts sind teils auch recht unspezifisch wink
Wenn ich Olli richtig verstanden habe, musst du nur ein bischen warten bis er mit seinem Modul fertig ist. Dann posted er seine Lösung inkl. nem kleinen Tutorial.

Doc
Logged
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1680



« Reply #20 on: January 31, 2010, 09:30:34 PM »

Hi,

I hope I will post a tutorial soon how to reorder members from members module via drag n drop

So far it is working with one group..


cheers
« Last Edit: January 31, 2010, 10:04:16 PM by crnogorac081 » Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
Olli

Offline Offline

Posts: 288


« Reply #21 on: February 27, 2010, 08:35:38 PM »

@crnogorac081:

did you make any progess yet? hadn't had time to do this on my own yet. will try to use the function from the WB core this evening.
Logged
chio
WebsiteBaker Org e.V.

Offline Offline

Posts: 2264


« Reply #22 on: February 28, 2010, 08:48:01 AM »

crnogorac sent me a working adapted members-module, and I made some more changes. It works on my localhost, but it doesnt work on my website. Dont know why..

You can have this version, but its not finished yet, I dont even know if it can be installed clean.
Logged

*weg*
doc
Guest
« Reply #23 on: February 28, 2010, 08:54:59 AM »

Hi,

Quote
It works on my localhost, but it doesnt work on my website.
Assuming both installations are identical, I would check for wrong absolute URLs in the Ajax or Javascript related parts of the modified files.

Doc
« Last Edit: February 28, 2010, 08:56:31 AM by doc » Logged
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1680



« Reply #24 on: February 28, 2010, 11:05:35 AM »

it works both on my local host and live server..

@chio

Could it be that you used it on two differnt WB versions:  2.8 and 2.8.1 ? and that it is not working on 2.8.1 ?

edit:

if yes -> there is an issue with wb 2.8.1 admin template... you must enable (uncoment) jquery-ui script in footer.htt in backend themes (or only the one you are using..). And this jquery-ui script is not comented in 2.8 so it works there without touching footer.htt

Ivan

edit2:

Here is css code, for backend.css and 2 files attached with tutorial how to use it.
Code:
#dragTable li {
    list-style: none;
    margin-top: 3px;
    width: 95%;
    list-style: none;
    padding: 2px;
    background-color:#F0F0F0;
    border: #CCCCCC solid 1px;
    color:#fff;
}

#dragResult {
    width: 90%;
    padding-left:10px;
}
« Last Edit: February 28, 2010, 12:33:45 PM by crnogorac081 » Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
Pages: [1] 2   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!