|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
6 R+ Y! u" l2 w( k5 W7 H2 i, t- }& ^ V8 V9 V) v8 R9 j/ W6 x
Technique
4 D* i( O7 B y# A& `Use the Item.getNextStates() method to get the next state values. This recipe ( t5 i- x7 \+ b, [5 L" L; N
assumes there is a select input field on the form for us to populate with state values. 7 [1 i" \9 z6 k4 E/ `2 t
HTML
z3 w3 U5 t6 _& k<select id="mySelect"></select> 0 p- A% x9 ^% o1 T3 X. ], g- c0 Y
JavaScript
, i7 ]6 q' s3 c y. }var results = document.thisItem.getNextStates();
+ G9 I- u1 E6 b' |5 _0 }var nextStates = results.getItemsByXPath('//Item[@type="Life Cycle State"]'); " v! G5 T7 V$ I" D
var count = nextStates.getItemCount();
3 W9 v u: m" R" R! o2 w2 e ! ~9 s7 a, ^' P3 K7 }. u7 u4 |1 E
var oSelect = document.getElementById('mySelect'); / b$ O; H, Q- p$ L" u' n7 m
for (var i=0; i<count; ++i) { % \ ~ X7 L" X9 q w5 n9 @
var item = nextStates.getItemByIndex(i);
1 n3 t+ d6 K. D7 m" S3 ~2 E var opt = document.createElement('option'); # g# b( W$ i: k
opt.text = item.getProperty('name'); 6 Z2 J& P; ^+ Y0 D: J+ S5 I
oSelect.add(opt);
R! G1 X7 k: v, z* s}
$ f. I5 F& N. p6 n; l# [
5 ]; w$ \- ^% R7 {8 p |
|