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 12/05/2011, 16h03   #1
Invité de passage
 
Inscription : février 2011
Messages : 15
Détails du profil
Informations forums :
Inscription : février 2011
Messages : 15
Points : 2
Points : 2
Par défaut sauvgarder la valeur de checkColumn

bonjour,

grâce au plugins checkColumn j'ai pu introduire une colone checkbox dans mon editorgrid,et pour que je puisse sauvegarder la valeur de mes champs j'ai utilisé un listener qui appel un url, mais quand je modifie la valeur de mon checkbox j'arrive pas à appeler l'url. voila le code que j'utilise

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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
var xg = Ext.grid;
    var checkColumn = new Ext.ux.grid.CheckColumn({
       header: 'indoor',
	   id:'indoor',
       dataIndex: 'indoor',
       width: 55,
	   xtype: 'booleancolumn',
 
    });
 
 
 
    var reader = new Ext.data.ArrayReader({
		id:'indoor'
	}, [
	 // {name: 'indoor', type: 'bool'},
	 {name: 'indoor', type: 'bool'},
       {name: 'company'},
       {name: 'price', type: 'float'},
       {name: 'change', type: 'float'},
       {name: 'pctChange', type: 'float'},
       {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'},
    ]);
 
 
	var store = new Ext.data.Store({
 
		url: 'grid.php',
		reader: new Ext.data.JsonReader({
			root:'rows',
			id:'idd'
		},[
			//'idd',
			{name:'idd',type:'float'},
			//'idd',
			'nom',
			'prenom',
			'service'
		])
		//,autoLoad: true
	});
 
	var nom_edit = new Ext.form.Checkbox();
	var test_edit = new Ext.form.TextField();
    var grid2 = new xg.EditorGridPanel({
        store: new Ext.data.Store({
            reader: reader,
            data: xg.dummyData
        }),
        cm: new xg.ColumnModel({
            defaults: {
                width: 120,
                sortable: true
            },
            columns: [
                checkColumn,
                {header: "Company", width: 200, dataIndex: 'company', editor:test_edit},
                {header: "Price", renderer: Ext.util.Format.usMoney, dataIndex: 'price'},
                {header: "Change", dataIndex: 'change'},
                {header: "% Change", dataIndex: 'pctChange'},
                {header: "Last Updated", width: 135, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
            ]
        }),
        columnLines: true,
		clickstoEdit: 1,
 
 		listeners:{
			afteredit: function(e){
				var conn= new Ext.data.Connection();
				conn.request({
					url:'ttt.php',
					params:{
						id: e.record.indoor,
						// ttt:e.record.price,
						field: e.field,
						value: e.value
					},
					success:function(resp,opt){
						e.record.commit();
					},
					failure: function(resp,opt){
						e.record.reject();
					}
				});
			}
		},
		plugins: checkColumn,
        width:600,
        height:300,
        frame:true,
        title:'Framed with Checkbox Selection and Horizontal Scrolling',
        iconCls:'icon-grid',
        renderTo: document.body
});
});
quelqu'un a déjà la solution ???
mido12 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 11h39.


 
 
 
 
Partenaires

Hébergement Web