Datagrid

来自ling
跳转至: 导航搜索
$(arg.dom).empty().xCreate({
    tagName: "IMG",
    src: $url(arg.data.get("filePath")),
    style: "margin: 2px;height:20px"
});
dorado.TipManager.initTip(arg.dom.parentNode,{
    content: {
        tagName: "IMG",
        src: $url(arg.data.get("filePath")),
        style: "height: 128px; margin: 8px"
    },
    arrowDirection: "top",
    arrowAlign: "left"
});

arg.dom.innerHTML="<a href='"+arg.data.get("filePath")+"'>"+arg.data.get("fileName")+"</a>";

var inspectMethodPages=arg.data.get("inspectMethodPages");
if(inspectMethodPages){
		$(arg.dom).empty().xCreate({
			tagName:"A",
			href:"#",
			content:productName,
			onclick:function(){
			alert("你想干什么");
			}
		});
}else{
	arg.dom.innerText="";
}

$(arg.dom).empty().xCreate(
			{
				tagName : "IMG",
				src : $url(">dorado/res/com/bstek/dorado/sample/data/images/"
						+ arg.data.get("product") + "-24.png"),
				style : "margin: 2px"
			});

	dorado.TipManager.initTip(arg.dom.parentNode, {
		content : {
			tagName : "IMG",
			src : $url(">dorado/res/com/bstek/dorado/sample/data/images/"
					+ arg.data.get("product") + "-128.png"),
			style : "width: 128px; height: 128px; margin: 8px"
		},
		arrowDirection : "top",
		arrowAlign : "left"
	});
// 这里例子为一个Grid定义了若干个表格列
new dorado.widget.Grid({
    columns: [
 
        /*
         * 这是一种$type的简写,当我们要定义的JSON的足够简单,即只需要定义$type时,
         * 我们就可以把它简化成一个只包含$type值的字符串。
         * 这里的额"*"就相当于{ $type: "*" },最终会被解释成dorado.wdiget.grid.IndicatorColumn。
         */
        "*",
        "#",  // 相当于dorado.wdiget.grid.RowNumColumn
        { property: "product" },
        { property: "manufacturer", width: 100 },
        {
            /*
             * 相当于dorado.wdiget.grid.ColumnGroup。
             * 事实上,这一行也可以省略,
             * 因为在Grid的逻辑代码中会自动根据一个JSON对象中是否存在columns属性来决定是否要将其实例化为ColumnGroup。
             */
            $type: "Group",
            caption: "volumn",
            columns: [
                { property: "length", width: 50 },
                { property: "width", width: 50 },
                { property: "height", width: 50 }
            ]
        },
        { property: "price" },
        { property: "commnet", width: 300 }
    ]
});
var submitFlowStatu = "${argument.submitFlowStatu}";
var grid = this.id("dataGridCharoleApply");
var dataset = this.id("dataSetCharoleApply");
var selecteddata = grid.get("selection");
if (!selecteddata || selecteddata.length == 0) {
    dorado.MessageBox.alert("请选择数据后再进行此操作!");
}
else {
    var action = this.id("ajaxActionFlowChage");
	var entity = this.id("autoFormAudit").get("entity");

    action.set("parameter", {
        charoleApplys: selecteddata,
        submitFlowStatu: submitFlowStatu,
		audit:entity.audit,
		auditmessage:entity.auditmessage		
    });
    dorado.MessageBox.confirm("您真的要取消当前申请么?", function(){
        action.execute(function(result){
            dorado.MessageBox.alert("操作完成");
            dataset.flush();
        });
    })
}
var refreshDisplay = function(view) {
	var evaluateDimension = view.id("dataSetEvaluateDef").getData(
			"#.evaluateDimension");
	if (evaluateDimension) {
		if ("1" == evaluateDimension) {
			view.get("^x").objects.each(function(element) {
				element.set("visible", true);
			});
			view.get("^y").objects.each(function(element) {
				element.set("visible", false);
			});
		} else if ("2" == evaluateDimension) {
			view.get("^x").objects.each(function(element) {
				element.set("visible", true);
			});
			
			view.get("^xx").objects.each(function(element) {
				element.set("visible", true);
			});

			view.get("^y").objects.each(function(element) {
				element.set("visible", true);
			});
		}else{
			view.get("^x").objects.each(function(element) {
				element.set("visible", false);
			});
			view.get("^xx").objects.each(function(element) {
				element.set("visible", false);
			});
			view.get("^y").objects.each(function(element) {
				element.set("visible", false);
			});
		}
	}
}
// @Bind #dataSetEvaluateDef.onLoadData
!function(self, arg) {
	var view = this;
	refreshDisplay(view);
}

// @Bind #dataGridEvaluateDimensionAndLevel.#color.onRenderCell
!function(self, arg) {
	var value = arg.data.get("color");
	if (value) {
		arg.dom.style.background = value;
	}
	arg.processDefault = true;
}

// @Bind @dataTypeEvaluateDefInParam.onDataChange
!function(self, arg) {
	var property = arg.property;
	var view = this;
	if (property == "evaluateDimension") {
		refreshDisplay(view);
	}
}
$(arg.dom).empty();
var entity = arg.data
var button = new dorado.widget.ProgressBar({
    tip: "剩余风险评估",
    renderTo: arg.dom,
    style:"color: yellow;background-color: white",
    value: entity.get("process")
});
var entitylist = arg.data.get("positions");
var name = [];
if (entitylist) {
	entitylist.each(function(item){
		name.push(item.get("name"));
	});
}
arg.dom.innerHTML = name.join(",");