日期:2014-05-16  浏览次数:20377 次

extjs中model的HasMany和belongTo读取xml数据的用法

论坛上看到的提问,于是就研究了一下,终于得出store中list嵌套如何用HasMany和BelongTo实现。

先看界面源码

 

<html>
<head>

<!-- Put your page Title here -->
<title> Cache Server Page </title>
<!-- 加载ExtJS -->
<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css"/>
<script src="extjs/resources/ext-all.js"></script>
<script src="extjs/resources/ext-lang-zh_CN.js"></script>
</head>

<body>
<script type="text/javascript">

Ext.onReady(function(){
Ext.QuickTips.init();
Ext.define('common.teacher',{
     extend:'Ext.data.Model',
     fields:['name'],
     proxy: {
        type: 'ajax',
        url:'Test.TestApplication.TestOneToMany.cls',
        reader: {