Page 1 of 1

Ext js Grid mit PHP keine Datenausgabe

Posted: 23 Dec 2024, 13:59
by Anonymous
Ich hoffe, Sie können mir bei meinem Problem helfen. Ich weiß nicht, welchen Code ich hinzufügen soll, um ein einfaches Raster mit PHP zu erstellen. Es werden keine Daten in das Raster ausgegeben. Ich habe diese im Tutorial gesehen, also erstelle ich eine PHP-Datei, die JSON und dann i ausgibt Erstellen Sie ein Raster und speichern Sie hier meinen Code

//hier ist mein Shop

Ext.define('Active.store.Employee', {
extend: 'Ext.data.JsonStore',

alias: 'store.employees',

proxy: {

type: 'ajax',
url: 'test.php',
reader: {
type: 'json',
rootProperty: 'data'
}
},

fields: ['name', 'bounty', 'power' ],
autoLoad:true,
});


//hier ist mein Raster

Ext.define('Active.view.main.Grid', {
extend: 'Ext.Panel',
xtype: 'grid',

require:['Active.view.main.Employee','Active.store.Employee'],

items:[{
style: 'padding-top: 10px;',
xtype: 'gridpanel',
style: 'margin-top:5px;margin-left:10px;',
columns : {
defaults: {
sortable: false,
menuDisabled: true
},
items: [
{ text: 'Name', dataIndex: 'name',width:'20%' },
{ text: 'Bounty', dataIndex: 'bounty',width:'20%'},
{ text: 'Power', dataIndex: 'power',width:'20%'},

]
},
store: {type: 'employees',},
width: '100%'

}],

});


//hier ist mein PHP-Code