2013-07-12 38 views
0

我使用JSON調用獲取數據並將其設置爲不同的商店,現在我已經修改了JSON結構以滿足ProgreesBar數據的一個更多需求。 我是否必須爲數據創建新的商店或模式,或者我可以從商店獲取它。如何爲以下數據創建存儲和模型?

{ 
    "data": [{ 
    "firstRun": { 
     "progress": 0, 
     "settingList": [{ 
     "settingName": "BoxTone Database Password", 
     "cssClass": "neutral", 
     "id": "linl_boxtone_db_passwoed" 
     }, { 
     "settingName": "Email Notification", 
     "cssClass": "fault", 
     "id": "email_notification_link" 
     }, { 
     "settingName": "User and Group Sync", 
     "cssClass": "neutral", 
     "id": "link_user_and_group_sync", 
     "listItem": [{ 
      "settingName": "User and Group Sync from ActiveDirectory", 
      "cssClass": "neutral", 
      "id": "link_user_and_group_sync_ad", 
      "listItem": "AL" 
     }, { 
      "settingName": "Add Groups", 
      "cssClass": "neutral", 
      "id": "link_add_groups", 
      "listItem": "AL" 
     }] 
     }, { 
     "settingName": "ActiveSync Log Share", 
     "cssClass": "neutral", 
     "id": "link_activesync_log_share" 
     }] 
    }, 
    "operate": { 
     "progress": 0.04, 
     "settingList": [{ 
     "settingName": "SNMP Alerting", 
     "cssClass": "neutral", 
     "id": "lnk_snmp_alerting" 
     }, { 
     "settingName": "BlackBerry Servers", 
     "cssClass": "neutral", 
     "id": "lnk_BlackBerryServers", 
     "listItem": [{ 
      "settingName": "BES 5.x Servers", 
      "cssClass": "neutral", 
      "id": "lnk_BESServers", 
      "listItem": "AL" 
     }, { 
      "settingName": "BES Logs", 
      "cssClass": "neutral", 
      "id": "lnk_BESLogs", 
      "listItem": "AL" 
     }, { 
      "settingName": "BES SNMP Alerting", 
      "cssClass": "neutral", 
      "id": "lnk_BESSNMPAlerting", 
      "listItem": "AL" 
     }] 
     }, { 
     "settingName": "Good For Enterprise (GFE) Servers", 
     "cssClass": "mixed", 
     "id": "gmServer", 
     "listItem": [{ 
      "settingName": "GFE Good Messaging Control (GMC) Servers", 
      "cssClass": "fault", 
      "id": "gmcServer", 
      "listItem": "AL" 
     }, { 
      "settingName": "GFE Good Mobile Messaging (GMM) Servers", 
      "cssClass": "saved", 
      "id": "gmmServer", 
      "listItem": "AL" 
     }, { 
      "settingName": "GFE Load Balancing", 
      "cssClass": "neutral", 
      "id": "gfe_load_balancing", 
      "listItem": "AL" 
     }] 
     }, { 
     "settingName": "Good Dynamics Servers", 
     "cssClass": "neutral", 
     "id": "lnk_GoodDynamicsServers", 
     "listItem": [{ 
      "settingName": "Good Control (GC) Servers", 
      "cssClass": "neutral", 
      "id": "lnk_GoodControlServers", 
      "listItem": "AL" 
     }] 
     }, { 
     "settingName": "Microsoft Exchange Activesync", 
     "cssClass": "neutral", 
     "id": "lnk_MicrosoftExchangeActivesync", 
     "listItem": [{ 
      "settingName": "HTTP Error Logs", 
      "cssClass": "neutral", 
      "id": "lnk_HTTPErrorLogs", 
      "listItem": "AL" 
     }, { 
      "settingName": "BES", 
      "cssClass": "neutral", 
      "id": "lnk_BES", 
      "listItem": "AL" 
     }] 
     }] 
    } 
    }], 
    "success": true 
} 
+1

取決於您需要如何使用數據。如果數據已經存儲在商店中,並且只需要值,那麼您可以簡單地檢索並使用它。如果您需要以類似於模型/商店的方式使用數據,那麼使用不同模型創建新商店可能是您需要做的。不知道你的確切要求,但很難說,因爲你可以在沒有模型和商店的情況下在ExtJS中做很多事情(並且還有很多)。 – existdissolve

回答

0

如果您的模型中沒有「進度」,您還可以從商店獲取原始數據。但是,這不會被強烈建議,因爲如果通過任何ExtJS方法,您將無法與數據交互的程度與您的模型中的數據相同。

相關問題