Hi,
I am having bit difficulty in getting the indviidual values from array. I havent used the proper store method as i was bit late in hearing about that. But is there anyway i could use something to split up the data that i am sending from the database?
My code is as follows :
Code:
Test.second= new Ext.Panel({
scroll:'vertical',
fullscreen: true,
baseCls : 'x-panel-mc',
id: 'second',
isteners: {
activate: function(){
schoolid = document.getElementById('school_id').value;
url = "classapp_html5/secondscreen.php";
data = "schoolid="+schoolid;
result = $.ajax({
url: url,
global: false,
type: "GET",
data: data,
async:false,
success: function(msg){
}
}
).responseText;
if((result!="no")&&(result!="")){
for (key in result)
{
array[key] = key;
document.getElementById(array[key]).innerHTML = key;
}
}
else{
document.getElementById('second').innerHTML = '<br><br><span style="color:#FFF">Some Error has occurred.Please try again later.</span><br><br>';
Test.Viewport.setActiveItem('first',{type:'slide', direction:'right'});
}
}
},
html:'<div><div class="homecontainer" align="center"><span class="welcome">Welcome to</span><br><span class="schoolred"><i>My</i> Galilee</span><br><div id="paneltwo"></div><div name="schoolhomecontent" id="schoolhomecontent"></div><div align="center"><img src="images/logo.png" align="center" height="30%" width="33%"></div><span class="classapphomeinnertext">This app will help keep you up to date with what is happening at Galilee Regional ,South Melbourneaaa.</span></div></div>',
dockedItems: [
]
});
And my php code is as follows :
Code:
$schoolid=$_REQUEST['schoolid'];
$query="select * from school_profile where id='$schoolid'";
$res = mysql_query($query);
echo $res;
So as per my code an array will be obtained as result in the ajax call in listeners. But i am not sure how i can split up the array elements so that i can display the values in the panel html. I have to repeat the same thing for like 15 panels to fetch values from database. So how can i split the values and use it in my panels..
Any help is largely appreciated,,,