View Full Version : Help with terminology - suggestion
yehosef
21 Aug 2007, 11:20 AM
Hi I'm working with Ext and it's great. One problem I run into is that I don't know what some of the terms in the API refer to. Perhaps it's my newness to JS..
Examples: I'm working a lot with the tree. In the TreePanel events there are a beforeAppend and a beforeInsert but the rest of the docs just seem to reuse the word (this appends.. this inserts.. etc.) but I don't know what the difference is.
or selectPath() - what exactly is a path?
There are other examples - is there a place these things are more completely explained?
If not, perhaps a suggestion for the documentation that it detail more about what each thing is and when to use it. A good option might be to have user comments/documentation like on the php.net so that users can share observations and code about a particular class/function/event/etc. If it was with ajax and revealing inline divs (the modal boxes might be annoying for documentation.. IMO) it could be very unobtrusive but helpful.
Jack, et al - thanks for making such a great library!
BernardChhun
21 Aug 2007, 12:07 PM
hey yehosef,
In the TreePanel, you are essentially working with TreeNodes. Thats why those verbs are often used and always means the same things.
Appending nodeA to nodeB is adding nodeA as nodeB's last childNode.
B
|-C
|-D
|-A
Inserting nodeA into nodeB is adding it between other childNodes.
B
|-C
|-A
|-D
A treeNode's path is the way to get to it.
A
|-B
|-C
|-D
|-E
in this case the path to nodeE is A/D/E
usually, the sentence describing the function's action is quite enough but don't be shy in pointing out errors in there.
Animal
21 Aug 2007, 10:57 PM
It's just English. If English is not your first language, you could use an online dictionary to find out what words mean.
yehosef
22 Aug 2007, 4:59 AM
BernardChhun,
Thanks for the helpful answers. To see if I understand:
if I drag something (node/leaf) onto a node - it'll fire the append event and if I drag it between nodes it'll fire the insert. Does this make a difference if the parent is a different parent from where it started (meaning I'm inserting into another branch as opposed to reording in the current parent?)
Perhaps you have a good suggestion - I'm working on something like the two tree example - but the left tree doesn't change (you can't add or remove nodes) and on the right tree you can drag nodes from the left tree or, once dragged over, you could drag it (either copy or move - still looking how to use CTRL-drag) from the right tree to the right tree.
For example - if I listen for append/insert, what should I do with dragdrop?
Also - I'm not sure I understand when the move event would fire - only when it's dragged to a different parent? Can I have multiple events firing together (eg, move and append).
many thanks -
-------------------
Animal - english is my first language and php is my second and mysql is my third. In my years of sql experience - whenever I wanted to make something new at the end of a table I would do an insert. That's what was confusing me.
While the documentation is accurate and succinct, adding a brief description like Bernard did would make it more clear. If the Ext people don't have time for it - why not open it to people like Bernard to make it more clear. Then, instead of searching through the forums, someone could look right in the documentation and get the answers they seek. Thats my suggestion.
Yehosef
BernardChhun
22 Aug 2007, 5:54 AM
if I drag something (node/leaf) onto a node - it'll fire the append event and if I drag it between nodes it'll fire the insert. Does this make a difference if the parent is a different parent from where it started (meaning I'm inserting into another branch as opposed to reording in the current parent?)
no differences, the same event should occur in those cases.
Perhaps you have a good suggestion - I'm working on something like the two tree example - but the left tree doesn't change (you can't add or remove nodes) and on the right tree you can drag nodes from the left tree or, once dragged over, you could drag it (either copy or move - still looking how to use CTRL-drag) from the right tree to the right tree.
For example - if I listen for append/insert, what should I do with dragdrop?
I wouldn't bother with the append/insert event cause you wouldn't be able to stop it for whatever reason if you wanted to. I'd use the "beforenodedrop" event instead to make sure every D&D action is catched.
Also - I'm not sure I understand when the move event would fire - only when it's dragged to a different parent? Can I have multiple events firing together (eg, move and append).
I haven't used much Drag & drop between trees yet but my guess is that multiple events would fire.
the best advice I could give you to explore the order in which those events are raised is the following code:
tree.on({
"move" : function(){console.log("move event");}
, "append" : function(){console.log("append event");}
, "insert" : function(){console.log("insert event");}
// and so on!
});
add events in there as you see 'em :)
and here's a little trick to see all events a widget handles:
var widgetInstance = new Ext.[...];
console.log(widgetInstance.events); // this should return an array of all events
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.