0
我正在使用PERL Miner :: Base和JavaScript平臺(.pm和.js)。 我的JavaScript包含3個ExtJS GridPanel。如何在ExtJS網格之間共享數據
現在,這裏是我的問題:
我有一個函數,約1分鐘運行,並返回到需要所有 3格中的數據引用的列表。我們稱這個函數爲「foo」。
目前,爲了加載我的每個網格的商店,我調用一個函數調用「foo」,並只返回由「foo」返回的列表中的相關引用。
我需要一種方法來調用「foo」只有一次並共享它在我的3商店之間返回的數據。
有沒有這樣的方式?
謝謝。
這裏是我的代碼的基本結構:
my_code.js:
gridA with storeA (calls my_code.pm::get_A_data)
gridB with storeB (calls my_code.pm::get_B_data)
gridC with storeC (calls my_code.pm::get_C_data)
my_code.pm:
get_A_data (calls foo and returns the first reference returned from foo)
get_B_data (calls foo and returns the second reference returned from foo)
get_C_data (calls foo and returns the third reference returned from foo)