Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old April 13th, 2007, 10:05 AM
Sascha Deus
Guest
 
Posts: n/a
Default Yahoo! UI + PHP Array

Hallo NG,

ich möchte gerne die Yahoo UI TreeView Komponenten mit Daten befüllen.
die aus PHP per ajay.request asynchron geladen werden.

Das Beispiel bei Yahoo stellt alles in html und javascript dar und nicht
die Verbindung zu PHP.

Es gab einen Artikel in der Internet Professional 09/2006, allerdings
ist genau der Teil, wo die Arrays oder Werte von JavaScript -PHP und
zurück nach JavaScript nicht ausführlich erläutert und ich komme einfach
nicht weiter.

Hat jemand Erfahrung damit oder kann mir helfen?

<script type="text/javascript">
//<![CDATA[

var tree;
function treeInit() {
tree = new YAHOO.widget.TreeView("treekfz");
tree.setDynamicLoad(loadDataForNode);

var root = tree.getRoot();


myobj = { label: "Mercedes", id:"myid2" } ;
var tmpNode2 = new YAHOO.widget.TextNode(myobj, root, false);

myobj = { label: "Volkswagen", id:"myid3" } ;
var tmpNode3 = new YAHOO.widget.TextNode(myobj, root, false);

tree.draw();
}

function loadDataForNode(node, onCompleteCallback) {
var id= node.data.id;
// -- code to get your data, possibly using Connect --
//var ajax=new Ajax.Updater("response","subnodes.php", {parameters:
"id="+id, asynchronous: false});

ajax.updateContent();

var tmpNode = new YAHOO.widget.TextNode(id + "label1", node, false);
tmpNode = new YAHOO.widget.TextNode(id + "label2", node, false);



// Be sure to notify the TreeView component when the data load is complete
onCompleteCallback();
}
</script>

Soweit bin ich. Was ich nicht verstehe, welche Parameter übergebe ich an
das PHP Script und welches Array muss ich zurückgeben in dem dann die
geholten Werte stehen?

Vielen Dank und Gruß
Sascha Deus
  #2  
Old April 13th, 2007, 10:15 AM
Rami Elomaa
Guest
 
Posts: n/a
Default Re: Yahoo! UI + PHP Array

Sascha Deus kirjoitti:
Quote:
Hallo NG,
>
ich möchte gerne die Yahoo UI TreeView Komponenten mit Daten befüllen.
die aus PHP per ajay.request asynchron geladen werden.
Could you please ask in English?

Err... Können Sie bitte im Englische fragen?
I'm sorry, I'm terrible at german... ^_^

--
Rami.Elomaa@gmail.com

"Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan
usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze
  #3  
Old April 13th, 2007, 10:35 AM
Sascha Deus
Guest
 
Posts: n/a
Default Re: Yahoo! UI + PHP Array

I'm not really good in english, but i will try it!

Hello,

i don't be able to fill the treeview component with data of an array,
filled by a php script.

Could any body help me, please?

The Examples of yui are really nice, but only in html and javascript.
I need an ajax.updater who calls a php script and fills in the subnodes
dynamically.


Rami Elomaa schrieb:
Quote:
Sascha Deus kirjoitti:
Quote:
>Hallo NG,
>>
>ich möchte gerne die Yahoo UI TreeView Komponenten mit Daten befüllen.
>die aus PHP per ajay.request asynchron geladen werden.
>
Could you please ask in English?
>
Err... Können Sie bitte im Englische fragen?
I'm sorry, I'm terrible at german... ^_^
>
  #4  
Old April 13th, 2007, 03:05 PM
Tyno Gendo
Guest
 
Posts: n/a
Default Re: Yahoo! UI + PHP Array

Sascha Deus wrote:
Quote:
I'm not really good in english, but i will try it!
>
Hello,
>
i don't be able to fill the treeview component with data of an array,
filled by a php script.
>
Could any body help me, please?
>
The Examples of yui are really nice, but only in html and javascript.
I need an ajax.updater who calls a php script and fills in the subnodes
dynamically.
>
>
Rami Elomaa schrieb:
Quote:
>Sascha Deus kirjoitti:
Quote:
>>Hallo NG,
>>>
>>ich möchte gerne die Yahoo UI TreeView Komponenten mit Daten befüllen.
>>die aus PHP per ajay.request asynchron geladen werden.
>>
>Could you please ask in English?
>>
>Err... Können Sie bitte im Englische fragen?
>I'm sorry, I'm terrible at german... ^_^
>>
I haven't looked, but you are either going to have to call your PHP with
Ajax whenever you need your tree changing, and either
a) Send back a delimited string with data in it, parsing with Javascript
or to build a javascript array
b) Use PHP to dynamically build your javascript code and then use
equivalent of eval in javascript to execute the returned code?

If i get time later i might take a look, just very busy at the mo.
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles