Hello all !
I'm very new on ExtJS and I need your help. 
I try to create an application witch is devided in two parts.
The first one is the PHP that generating an XML File :
PHP Code:
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
header("Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" );
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-Type: application/xml");
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo '<dataset>';
echo '<total>';
echo $total;
echo '</total>';
foreach($data as $dt)
{
echo '<data>';
echo '<id>';
echo $dt['Group']['id'];
echo '</id>';
echo '<name>';
echo $dt['Group']['name'];
echo '</name>';
echo '</data>';
}
echo '</dataset>';
?>
The above code is working perfectly !
It generating the XML correctly;
the XML Code that I'm getting back is the following one :
Code:
<?xml version="1.0" encoding="UTF-8" ?>
<dataset>
<total>3</total>
<data>
<id>1</id>
<name>Administrators</name>
</data>
<data>
<id>2</id>
<name>Managers</name>
</data>
<data>
<id>3</id>
<name>Users</name>
</data>
</dataset>
The second part is the ExtJS.
Is already installed in my page and I try to load the xml on it but I have problem
The code is the following :
Code:
Ext.onReady(
function()
{
var groupDS = new Ext.data.Store(
{
reader: new Ext.data.XmlReader(
{
record: 'data',
id: 'id'
},
[
'id',
'name'
]
),
url: 'http://www.myserveraddress.dch/Groups/view'
}
);
groupDS.load();
var vp = new Ext.Viewport(
{
renderTo: Ext.getBody,
layout: 'border',
items:
[
{
region: 'north',
xtype: 'toolbar',
height: '25',
items:
[
menuToolBar
]
},
{
region: 'west',
margins: '5 0 5 5',
split: true,
width: 280,
closable: true,
layout: 'accordion',
layoutConfig:
{
animate: true,
activeOnTop: false,
fill: true
},
items:
[
{
title: "Users & Groups",
xtype: 'panel',
items:
[
{
title: "Example panel 1",
collapsible: true,
xtype: 'form',
items:
[
{
xtype: "combo",
fieldLabel: "Groups",
name: "groups",
store: groupDS,
mode: 'local',
displayField: 'name'
}
]
},
{
title: "Example panel 2",
collapsible: true,
xtype: 'panel',
height: 200
},
{
title: "Example panel 3",
collapsible: true,
xtype: 'panel',
height: 200
},
{
title: "Example panel 4",
collapsible: true,
xtype: 'panel',
height: 200,
id: 'panel4'
}
]
},
{
title: "Again hello !"
}
]
},
{
region: 'center',
xtype: 'panel',
id: 'Hello'
},
{
region: 'south',
xtype: 'toolbar',
height: '25',
items:
[
statusToolBar
]
}
]
}
);
}
);
The problem is that I can't get the data from the XmlReader and place it into the combo ! !
I have try many methods but It can't work ! ! !
What can I do ? ? ?
Kind regards Merianos nikos