「Ext2.2 about」:修訂間差異
出自DILA Wiki
imported>Duncan 無編輯摘要 |
imported>Duncan |
||
行 13: | 行 13: | ||
==如果傳參數給Ext ,當成動態網頁== | ==如果傳參數給Ext ,當成動態網頁 (test in FF IE67 Opera safari) == | ||
var book=''; | var book=''; | ||
行 22: | 行 22: | ||
else | else | ||
alert('no params=book'); | alert('no params=book'); | ||
//code here for param | //code here for param | ||
行 33: | 行 29: | ||
在經過params = Ext.urlDecode(window.location.search.substring(1));後 | 在經過params = Ext.urlDecode(window.location.search.substring(1));後 | ||
我可以用變數params,取得 | 我可以用變數params,取得 | ||
params.book | |||
params.mondy |
於 2008年12月17日 (三) 22:56 的修訂
使用arraytree
如果你要使用tree狀清單元件,並且有在html loaded之後就要展開某個節點的需求的話,請使用下面的範例:
我在佛寺志這個專案 http://dev.ddbc.edu.tw/fosizhi/index.html 使用了上面的範例
唯一不同的是,我需要使用來自server端的資料,所以我以ajax開啟檔案,再以eval()函式處理成array,這樣一來就符合它的要求。 (需要看的人,到http://dev.ddbc.edu.tw/fosizhi/index.html,把網頁另存新檔,可以看到所有的js code寫在function.js)
如果傳參數給Ext ,當成動態網頁 (test in FF IE67 Opera safari)
var book=; params = Ext.urlDecode(window.location.search.substring(1));
if(params.book) book=params.book; else alert('no params=book');
//code here for param
如果我的url是 http://duncan.home.com.tw/?book=play&money=1000
在經過params = Ext.urlDecode(window.location.search.substring(1));後
我可以用變數params,取得
params.book
params.mondy