Extjs4.1 - How to working with processbar and php
I try to create a processbar wait for server do something. When server
finish then processbar will completed.
Here is my js
var pbar4 = Ext.create('Ext.ProgressBar', {
text:'Waiting on you...',
width: 300,
renderTo:Ext.getBody()
});
Ext.Ajax.request({
url: 'getStatus.php',
success: function(r) {
if (r.responseText == 100)
pbar4.updateText('All finished!');
else
pbar4.updateProgress(r.responseText, r.responseText+'%
completed...');
}
});
and getStatus.php
$total = 10000;
for ($i = 0; $i <= $total; $i++) {
echo $i/$total*100;
}
But when i run that look like
How to do that thanks
No comments:
Post a Comment