Connecting Tech Pros Worldwide Help | Site Map

Yahoo! UI + PHP Array

  #1  
Old April 13th, 2007, 10:05 AM
Sascha Deus
Guest
 
Posts: n/a
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

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

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

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.
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP File Upload Fails Vic Spainhower answers 6 December 4th, 2006 11:35 PM
undefined array index question petermichaux@yahoo.com answers 9 September 18th, 2005 05:55 PM
Needs help with old PHP scrips on new server with update version of PHP laurie answers 3 July 17th, 2005 03:25 AM
Basic array stuff... Why [0] & ['key'] and [1] & ['value'] 'duplication'? Glutinous answers 4 July 17th, 2005 01:55 AM
storing an array in a db Alexander Ross answers 3 July 17th, 2005 12:02 AM