PDA

View Full Version : [SOLVED] Progress Bar not Updating



mhoover12
10 Jan 2011, 8:30 AM
I have never attempted to use a Progress Bar before, and for some reason it is not as straightforward to use as I would have anticipated. I assume I am making some kind of silly, small error.

Anyway, here are my config options for the progress bar I have built:

xtype: 'progress',
id: 'geocodeProgressBar',
ref: 'geocodeProgressBar',
text: 'Initializing...',
height: 15

And later, I call the following method:

var updateValue = this.completedRecords / this.records;
var updateText = ((this.completedRecords / this.records) * 100).toFixed(0) + '%';
this.geocodeProgressBar.updateProgress(updateValue, updateText);

The progress bar seems to always reset to 0, whether I set its initial value as something else or not. The values within updateValue and updateText are valid and should be moving the Progress Bar along.

Any light that could be shed on this issue would be greatly appreciated.

Thanks,
Mark

EDIT: I can get the value to change, but it is not behaving as I expect it to. The described behavior in the documentation of passing a float between 0 and 1 tends to reduce whatever current value the bar holds. Making it a value higher than 1 makes it fill up the whole bar. And my updateText is never displayed.

[SOLVED] With no width assigned it was using auto-width and only drawing as wide as the updated value. So if it was trying to update to 33% from 100%, it would shrink the actual size of the bar down to that width as well. Setting the width resolved the issue.