Tuesday, May 6, 2014

Progress Bar EXTJS

progress.html
<html>
<html>
<head>
    <title>Progress</title>
   
    <!-- Ext JS Files -->
    <!-- Ext JS Files -->
    <link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css">
    <script type="text/javascript" src="extjs/ext-all-debug.js"></script>
   
    <!-- App Files -->
    <script type="text/javascript" src="progress.js"></script>
   
</head>
<body></body>
</html>

progress.js
Ext.onReady(function() {
    var pgb = Ext.create('Ext.ProgressBar', {
        text: 'Updating...',
        width: 200
    });

    var smenu = Ext.create('Ext.menu.Menu', {
        width: 200,
        plain: true,
        float: true,
        shadow: true,
        frame: true,
        items: [
            pgb
        ]
    });

    smenu.show();

    var prog = 0;

    setInterval(function() {
        prog = (prog + 5) % 105;

        pgb.updateProgress(prog / 100);
    }, 100);
});

No comments:

Post a Comment