【Aras Innovator二次开发】8 创建一个自定义表单在TOC上展示
【Aras Innovator二次开发】创建一个自定义表单在TOC上展示结果如下,点击Change Management标签,自动弹出统计界面
(1) 创建一个 Form表单,名字叫 Change Management,添加相应控件,注意控件ID命名
(2)关联一个 on load的事件,使用 JavaScript 的方式
(3)对整个事件进行代码
完成后即可看到相关效果。
代码如下:
//get the ECR Collection
var newCount=0,submittedCount=0,reviewedCount=0,releasedCount=0,cancelCount=0;
var currentItem = null;
var currentState ="";
var innovator = aras.newIOMInnovator();
var item = innovator.newItem("ECR","get");
item.setAttribute("select","state");
var ecr_items = item.apply();
var totalCount = ecr_items.GetItemCount();
for( i=0; i<totalCount; i++)
{
current_item = ecr_items.getItemByIndex(i);
current_state = current_item.getProperty("state");
switch(current_state)
{
case "New":
newCount++;
break;
case "Submitted":
submittedCount++;
break;
case "In Review":
reviewedCount++;
break;
case "Released":
releasedCount++;
break;
case "Cancelled":
cancelCount++;
break;
}
}
document.getElementById("MainDataForm").textNew.value=newCount;
document.getElementById("MainDataForm").textSubmitted.value=submittedCount;
document.getElementById("MainDataForm").textReviewed.value=reviewedCount;
document.getElementById("MainDataForm").textReleased.value=releasedCount;
document.getElementById("MainDataForm").textCancelled.value=cancelCount;
document.getElementById("MainDataForm").textTotal.value=totalCount;
页:
[1]