|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
( k8 j7 C( A: w# Z, u3 D: `
& P, t" W4 j/ E) p( K
Technique 4 j9 z% l' T! _7 g! @2 b! ]
Use the Item.getNextStates() method to get the next state values. This recipe 0 t! K5 h1 ~+ z7 a: j5 s: X6 _
assumes there is a select input field on the form for us to populate with state values. - Q5 n0 {, R/ h
HTML + O* C4 Z# D1 e0 n
<select id="mySelect"></select>
* w* W0 w: a# z8 x) a' }JavaScript
/ E* n" a# |+ l+ }var results = document.thisItem.getNextStates();
6 U5 [8 U. J$ }: i* s6 {/ Fvar nextStates = results.getItemsByXPath('//Item[@type="Life Cycle State"]');
7 t, ]' W0 e8 C S* fvar count = nextStates.getItemCount();
- v) K* w+ O% O3 T
# J t9 ^5 C+ m/ h6 x; g3 kvar oSelect = document.getElementById('mySelect'); 3 _, D) K9 Y/ Q
for (var i=0; i<count; ++i) { ( { u' E% ?3 n; T
var item = nextStates.getItemByIndex(i); 3 y. ^ Z, b+ p1 x( S
var opt = document.createElement('option'); $ j' H0 ^* ?- k: k! R7 C) B
opt.text = item.getProperty('name'); : l& r0 l1 Q4 W+ r4 W
oSelect.add(opt); , [0 j+ c, V7 l+ H" k" N: D) [: B. I
} ; b0 q7 S8 l4 u$ d. d, T* c/ k
; C: k9 c* H) z/ R% c5 j8 W |
|