Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > JavaScript > Bibliothèques & Frameworks > Ext JS / Sencha
Ext JS / Sencha Ext JS / Sencha Forum d'entraide sur les frameworks Ext JS et Sencha. Avant de poster : FAQ ExtJS / Sencha, Toutes les FAQ JavaScript
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 07/07/2011, 17h34   #1
Membre du Club
 
Inscription : mars 2006
Messages : 90
Détails du profil
Informations forums :
Inscription : mars 2006
Messages : 90
Points : 50
Points : 50
Par défaut [extjs] JsonStore ne fonctionne pas

Bonjour voici un code tout simple, mais il ne fonctionne pas, j'ai le message "Loading" mais rien ne se passe :

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<title>Ext.PropertyGrid with JsonStore</title>
	<link type="text/css" rel="stylesheet" media="all" href="ext/resources/css/ext-all.css" />
	<script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script>
	<script type="text/javascript" src="ext/ext-all-debug.js"></script>
</head>
<body>
 <script>
Ext.require([
    'Ext.grid.*',
    'Ext.data.*',
    'Ext.util.*',
    'Ext.state.*'
]);
 
Ext.onReady(function() {
    Ext.QuickTips.init();
 
 
	var store = new Ext.data.JsonStore({
        autoLoad: true,  //autoload the data
        url: 'getproperties.php',
        root: 'props',
        fields: ['First name', 'Last name', 'E-mail'],
    }); 
 
    // create the Grid
    var grid = Ext.create('Ext.grid.Panel', {
        store: store,
        stateful: true,
        stateId: 'stateGrid',
        columns: [
            {
                text     : 'Company',
                flex     : 1,
                sortable : false,
                dataIndex: 'company'
            },
            {
                text     : 'Price',
                width    : 75,
                sortable : true,
                renderer : 'usMoney',
                dataIndex: 'price'
            },
            {
                text     : 'Change',
                width    : 75,
                sortable : true,
                dataIndex: 'change'
            }
        ],
        height: 350,
        width: 400,
        title: 'Array Grid',
        renderTo: 'grid-example',
        viewConfig: {
            stripeRows: true
        }
    });
});
 
 
</script>
	<div id="grid-example"></div>
 
</body>
</html>
et je getproperties.php
Code :
1
2
3
4
5
6
7
{"props":[
    {
        "First name":"John",
        "Last name":"Smith",
        "E-mail":"jsmith@smith.com"
    }
]}

Si quelqu'un voit le souci... merci beaucoup
Hesiode est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 11/07/2011, 02h53   #2
Membre confirmé
 
Inscription : février 2010
Messages : 267
Détails du profil
Informations forums :
Inscription : février 2010
Messages : 267
Points : 297
Points : 297
mm ... a mon avis, c'est ton url ...
a vérifier sur firebug

Takitano,
takitano est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 03h58.


 
 
 
 
Partenaires

Hébergement Web