Jun 27, 2013, 5:38 AM
[CLOSED] Progress Bar - wrap text
Please, if possible, in a progress bar I would that a long message text wrap to the next line and text fit centered horiz and vert.
if this is in ext context, could you give me a tip ?
i tought that putting the long msg in a <div> section could force to automatically wrap text
if this is in ext context, could you give me a tip ?
i tought that putting the long msg in a <div> section could force to automatically wrap text
progress.updateText('<div id="ecco"> Done. This message is intentionally very long but could change </div>');
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<title>ProgressBar - Ext.NET Examples</title>
<link href="/resources/css/examples.css" rel="stylesheet" />
<style type="text/css">
.x-progress.center-text .x-progress-text
{
height: 50px;
line-height: 50px;
}
#ecco
{
width: 200px;
height: 50px;
}
</style>
<script>
var updateBar = function (value, pbar, btn, count, callback) {
if (value > count) {
btn.setDisabled(false);
callback();
} else {
pbar.updateProgress(value / count, 'Loading item ' + value + ' of ' + count + '...');
}
}
var run = function (pbar, btn, count, callback) {
btn.setDisabled(true);
var ms = 5000 / count;
for (var i = 1; i < (count + 2); i++) {
setTimeout(Ext.Function.pass(updateBar, [i, pbar, btn, count, callback]), i * ms);
}
}
var runProgress2 = function (progress, btn) {
progress.show();
run(progress, btn, 12, function () {
progress.reset();
progress.updateText('<div id="ecco"> Done. This message is intentionally very long but could change </div>');
});
}
</script>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<h1>
Progress Bar with centered test - If too long I would it wraps</h1>
<p>
<ext:Button ID="Button1" runat="server" Text="Show">
<Listeners>
<Click Handler="runProgress2(#{Progress2}, this);" />
</Listeners>
</ext:Button>
<br />
<ext:ProgressBar ID="Progress2" runat="server" Width="200" Height="50" Text="Ready"
Cls="center-text" />
</p>
</form>
</body>
</html>
Last edited by Daniil; Jul 04, 2013 at 8:01 AM.
Reason: [CLOSED]