-2

I want to generate a progressbar for time (Assume 1 min). Means user should see 0 to 100% feature for 1 min.

isc.DynamicForm.create({
    ID:"DynamicForm51",
    autoDraw:false,


})

var importSection = isc.DynamicForm.create({
    ID:"DynamicForm42",
    autoDraw:false,
    numCols:2,
    width:950,
    items:[
        {
            name:"ImportSection",
            titleAlign:"center",
            textAlign:"center",
            align:"center",
            redrawOnChange:true,
            hoverAlign:"left",
            _constructor:"SelectItem"
        },
        {

            editorType: "button",

            //name:"SubmitItem",
            title:"Submit",
            align:"right",
            shouldSaveValue: true,
            _constructor:"SubmitItem",
            click : function() {

                //progressBar.hide();
                move();
                importSection.addItem(progressBar);

            }

        },
        {
            name:"Browse",
            textAlign:"right",
            align:"right",
            _constructor:"ButtonItem",
        },
        {
            colSpan:"*",
            endRow:true,
            //name:"CanvasItem0",
            showTitle:true,
            startRow:true,
            width:"*",
            canvas:DynamicForm51,
            _constructor:"CanvasItem"
        }



    ],

    cellPadding:2,
    minColWidth:20,
    fixedColWidths:false,
    saveOnEnter:true,
    titleOrientation:"left",
    titleWidth:500,
    layoutAlign:"right",
    visibility:"visible"

})

var progressBar = isc.Progressbar.create ({
    title: "Current Status Indicator",
    ID: "progressBar",
    showTitle:true,
    //ID: "progressBar",
    name: "progressBar",
    shouldSaveValue: true,
    //width:25,
    //height:10,
    length:250,
    titleAlign: "center",
    titleOrientation: "left",
    animateMoveTime: 10,

})

progressBar.hide();

function move() {

    //progressBar.show();

    progressBar.setPercentDone(50);


}

console.log(5):
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Revanth Tv
  • 63
  • 8
  • http://www.smartclient.com/smartclient-11.0/isomorphic/system/reference/SmartClient_Reference.html#search=progressbar using smart client framework. Thanks in advance for the answers – Revanth Tv Jan 17 '17 at 17:19
  • Your question is completely unreadable -- can you format your code and explain where in the code you are having an issue? – Grisha Levit Jan 17 '17 at 18:38
  • What is your question? – Quality Catalyst Jan 17 '17 at 19:13
  • @GrishaLevit my question is "How to write logic for progress bar showing the feature of loading from 0 to 100% for a time period assumed to be 1 minute?" And i don't have any issue in the code which i had uploaded, but i'm unable to figure out the logic for a progress bar which should show the data for a time period assumed. – Revanth Tv Jan 18 '17 at 07:40
  • I guess setinterval function can be used inside move function in the attached code above. but i am unable to figure it out how to apply the logic – Revanth Tv Jan 18 '17 at 12:01
  • whenever user clicks on submit button a new progress bar is created. How to stop creating multiple progressbars ? That means showing only one progressbar everytime when clicking on submit button. – Revanth Tv Jan 18 '17 at 13:15

1 Answers1

1
function update() {
var barValue = 0;
var maxValue = 100;
setInterval(function() {
       //var barValue = (1 + 100 * Math.random());  
        barValue += 5;
        progressBar.setPercentDone(barValue);
        //progressBar.animateShow();
         if (barValue >= maxValue) clearInterval(progressbar);
        progressBar.animateShow();

        console.log(barValue);

}, 1000); }

Revanth Tv
  • 63
  • 8