55 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
			
		
		
	
	
			55 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
var menuID = 'Menu1';
 | 
						||
// 返回false,来阻止浏览器右键菜单
 | 
						||
function onRowContextMenu(event, rowId) {
 | 
						||
    F(menuID).show();  //showAt(event.pageX, event.pageY);
 | 
						||
    return false;
 | 
						||
}
 | 
						||
function reloadGrid() {
 | 
						||
    __doPostBack(null, 'reloadGrid');
 | 
						||
}
 | 
						||
 | 
						||
 | 
						||
function parse(y) {
 | 
						||
    var box = document.getElementById("box");
 | 
						||
    //获取进度条div的宽度
 | 
						||
    var x = box.style.width;
 | 
						||
    x = parseInt(x) + 1;
 | 
						||
    y = y + 1;
 | 
						||
    //将y值加上百分号赋值给box的宽度。这样每次+1就可以实现进度条占父容器的100%;
 | 
						||
    box.style.width = y + "%";
 | 
						||
    //将y值加上百分号并赋值给显示下载百分比的div上
 | 
						||
    document.getElementById("box").innerHTML = y + "%";
 | 
						||
    //判断当y已经100的时候,也就是进度条的宽度和父容器的宽度一致的时候停止。
 | 
						||
    if (y >= 100) {
 | 
						||
 | 
						||
        document.getElementById("box").innerHTML = "100%";
 | 
						||
    }
 | 
						||
}
 | 
						||
 | 
						||
 | 
						||
 | 
						||
 
 | 
						||
 | 
						||
function printX() {
 | 
						||
    var userid = document.getElementById('id-inputEl').value;
 | 
						||
    F.ui.Window2.show();
 | 
						||
    parse(0);
 | 
						||
    var begin = setInterval(function () {
 | 
						||
        PageMethods.getPercent(userid,function (result) {
 | 
						||
            console.log(result);
 | 
						||
            parse(result);
 | 
						||
            if (result >= 100) {
 | 
						||
                F.ui.Window2.hide();
 | 
						||
                document.getElementById('btnRefresh').click();
 | 
						||
                 clearInterval(begin);
 | 
						||
            }
 | 
						||
        });
 | 
						||
    }, 1000);
 | 
						||
 | 
						||
 | 
						||
    y = 0;
 | 
						||
  
 | 
						||
 | 
						||
 | 
						||
} 
 |