2014-05-20 32 views
0

如何通過減去列表控件組來顯示列表控件?如何通過減去列表控件組來顯示列表控件? - livecode

這裏我的代碼:

on refreshlistoj idCardCur 
    set the dgData of grp "dgG" of card "Main" of stack stackmain to get_elementtodg(idCardCur) 
end refreshlistoj 

function get_elementtodg namecurrent 
    if namecurrent is not empty then 
     set the dgData of group "dgG" of stack stackmain to empty 
     put the number of controls of card ID namecurrent of stack stackname into numCon 
     repeat with crd = 1 to numCon 
     put the name of control crd of card ID namecurrent of stack stackname into theDataA[crd]["Col 1"] 
     put the short name of control crd of card ID namecurrent of stack stackname into theDataA[crd]["Col 2"] 
     end repeat 
     return theDataA 
    end if 
end get_elementtodg 

我的代碼有節目單的所有控件。

回答

0

childControlNames返回組的所有控件。 childControlIDs返回組的所有控件的ID號列表。如果你想獲得任何團體,卡或堆棧的列表,你可以使用以下處理:

getProp allControls 
    if word 1 of the name of the target is among the items of "group,card,stack" then 
    put the long id of the target into myTarget 
    repeat with x = 1 to the number of controls of myTarget 
     put the long id of control x of myTarget & cr after myList 
    end repeat 
    end if 
    return char 1 to -2 of myList 
end allControls 

將這個變成你的mainstack,在使用堆棧或backscript的腳本,並把它作爲

get the allControls of stack "Your Stack" 
put the allCOntrols of cd 1 into fld 1 
-- etc 

看來你想用這個數據網格。如果你可以解釋爲什麼你想要這個,我可能會改進我的答案。

+0

我之所以要這樣做,是因爲我想讓它像Livecode中的項目瀏覽器一樣。 – KemChat

+0

如果你只需要一個完整的控件列表,它不只是關於數據網格,那麼我認爲我的例子就足夠了。你可以想象我們如何自己在數據網格中顯示數據。 – Mark

+0

謝謝。 我有問題要問你。現在,我可以輕鬆地進行滾動組,並且可以減輕你在IOS上滑動時的感覺,但是我不能。你可以爲我示範嗎? – KemChat