如何为以下数据创建商店和模型?

时间:2013-07-12 10:22:30

标签: extjs4 modal-dialog store

我正在使用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 个答案:

答案 0 :(得分:0)

如果您的模型中没有“进度”,您还可以从商店获取原始数据。但是,这不会被强烈建议,因为您将无法通过任何ExtJS方法与您在模型中的数据进行交互。