代码之家  ›  专栏  ›  技术社区  ›  Revanth Tv

通过SubmitButton生成进度条。想要为时间生成进度条(假设1分钟)。表示用户应在1分钟内看到0到100%的功能

  •  -2
  • Revanth Tv  · 技术社区  · 7 年前

    我想生成一个 progressbar 时间(假设1分钟)。这意味着用户应该看到 0 100% 功能1分钟。

    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):
    
    1 回复  |  直到 7 年前
        1
  •  1
  •   Revanth Tv    7 年前
    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); }