shensi
9 Apr 2012, 1:49 AM
How server side CRUD works ?
Hi, I am new to sencha and thanks to many examples ext-4.0.7-gpl contains, I managed to make it works on client side. I am wondering why I don't find much informations about the server side content :
>>app.php
>> remote
>> | -init.php
>> | -lib
>>>> | -----application_controller.php
>>>> | -----model.php
>>>> | -----request.php
>>>> | -----response.php
>>>> | -----session_db.php
>> | -app
>>>> | -----models
>>>> | -----controllers
That's the only one link I found about this subject (http://joekuan.wordpress.com/2011/01/10/how-to-use-ext-js-crud-php-example/)
I managed, with the sencha's documentation to get it on server side / client side to send data and receive them in a store. The only description is translation and storage in standard column/row through json,xml in order to make it easily in client side... Perhaps I didn't understand everything as I am a beginner :-)
So Could someone explain me how to use and personalize CRUD ?
How do I get my sent parameters on server side ?
I have a dataStore, wich displayed my static json's data from a file properly ! Cool
I would like to make a mysql select and filtered it with an ID sent as a parameter but it doesn't work and mysql return an error because of this ...
And when I set statically this ID on server Side, ajax request works perfectly
Here is the error message from firebug
<br /><b>Warning</b>: require(remote/app/controllers/.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in <b>/usr/local/domos/www/sencha/examples/feed-viewer/app.php</b> on line <b>10</b><br /><br /><b>Fatal error</b>: require() [<a href='function.require'>function.require</a>]: Failed opening required 'remote/app/controllers/.php' (include_path='.:/usr/share/php:/usr/share/pear') in <b>/usr/local/domos/www/sencha/examples/feed-viewer/app.php</b> on line <b>10</b><br />
Unable to parse the JSON returned by the server: You're trying to decode an invalid JSON String: <br /><b>Warning</b>: require(remote/app/controllers/.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in <b>/usr/local/domos/www/sencha/examples/feed-viewer/app.php</b> on line <b>10</b><br /><br /><b>Fatal error</b>: require() [<a href='function.require'>function.require</a>]: Failed opening required 'remote/app/controllers/.php' (include_path='.:/usr/share/php:/usr/share/pear') in <b>/usr/local/domos/www/sencha/examples/feed-viewer/app.php</b> on line <b>10</b><br />' when calling method: [nsIDOMEventListener::handleEvent]
FYI Here is my dataStore:
Ext.apply(this, {
cls: 'feed-grid',
store: Ext.create('Ext.data.Store', {
model: 'DeviceDetails',
sortInfo: {
property: 'datetime',
direction: 'DESC'
},
proxy: {
type: 'ajax',
//url: 'data/devices.json',
url: 'app.php/events/view',
reader: {
type: 'json',
root: 'data'
}
},
listeners: {
load: this.onLoad,
scope: this
}
}),
columns: [{
text: 'Source',
dataIndex: 'source',
flex: 1,
renderer: this.formatTitle
}, {
text: 'Type',
dataIndex: 'type',
//hidden: true,
//width: 200,
flex: 1,
renderer: this.formatTitle
}, {
text: 'Value',
dataIndex: 'value'
//hidden: true,
//width: 200
}, {
text: 'Date',
dataIndex: 'datetime',
renderer: this.formatDate,
width: 200
}]
});
this.callParent(arguments);
this.on('selectionchange', this.onSelect, this);
},
FYI Here is my method to load and fill my dataStore
loadDevice: function(dID){
console.log("DeviceGrid::loadDevice -> " + dID);
var store = this.store;
store.load({
params: {
dID: dID
}
});
},
And sorry for my bad english !
Regards,
Shensi
Hi, I am new to sencha and thanks to many examples ext-4.0.7-gpl contains, I managed to make it works on client side. I am wondering why I don't find much informations about the server side content :
>>app.php
>> remote
>> | -init.php
>> | -lib
>>>> | -----application_controller.php
>>>> | -----model.php
>>>> | -----request.php
>>>> | -----response.php
>>>> | -----session_db.php
>> | -app
>>>> | -----models
>>>> | -----controllers
That's the only one link I found about this subject (http://joekuan.wordpress.com/2011/01/10/how-to-use-ext-js-crud-php-example/)
I managed, with the sencha's documentation to get it on server side / client side to send data and receive them in a store. The only description is translation and storage in standard column/row through json,xml in order to make it easily in client side... Perhaps I didn't understand everything as I am a beginner :-)
So Could someone explain me how to use and personalize CRUD ?
How do I get my sent parameters on server side ?
I have a dataStore, wich displayed my static json's data from a file properly ! Cool
I would like to make a mysql select and filtered it with an ID sent as a parameter but it doesn't work and mysql return an error because of this ...
And when I set statically this ID on server Side, ajax request works perfectly
Here is the error message from firebug
<br /><b>Warning</b>: require(remote/app/controllers/.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in <b>/usr/local/domos/www/sencha/examples/feed-viewer/app.php</b> on line <b>10</b><br /><br /><b>Fatal error</b>: require() [<a href='function.require'>function.require</a>]: Failed opening required 'remote/app/controllers/.php' (include_path='.:/usr/share/php:/usr/share/pear') in <b>/usr/local/domos/www/sencha/examples/feed-viewer/app.php</b> on line <b>10</b><br />
Unable to parse the JSON returned by the server: You're trying to decode an invalid JSON String: <br /><b>Warning</b>: require(remote/app/controllers/.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in <b>/usr/local/domos/www/sencha/examples/feed-viewer/app.php</b> on line <b>10</b><br /><br /><b>Fatal error</b>: require() [<a href='function.require'>function.require</a>]: Failed opening required 'remote/app/controllers/.php' (include_path='.:/usr/share/php:/usr/share/pear') in <b>/usr/local/domos/www/sencha/examples/feed-viewer/app.php</b> on line <b>10</b><br />' when calling method: [nsIDOMEventListener::handleEvent]
FYI Here is my dataStore:
Ext.apply(this, {
cls: 'feed-grid',
store: Ext.create('Ext.data.Store', {
model: 'DeviceDetails',
sortInfo: {
property: 'datetime',
direction: 'DESC'
},
proxy: {
type: 'ajax',
//url: 'data/devices.json',
url: 'app.php/events/view',
reader: {
type: 'json',
root: 'data'
}
},
listeners: {
load: this.onLoad,
scope: this
}
}),
columns: [{
text: 'Source',
dataIndex: 'source',
flex: 1,
renderer: this.formatTitle
}, {
text: 'Type',
dataIndex: 'type',
//hidden: true,
//width: 200,
flex: 1,
renderer: this.formatTitle
}, {
text: 'Value',
dataIndex: 'value'
//hidden: true,
//width: 200
}, {
text: 'Date',
dataIndex: 'datetime',
renderer: this.formatDate,
width: 200
}]
});
this.callParent(arguments);
this.on('selectionchange', this.onSelect, this);
},
FYI Here is my method to load and fill my dataStore
loadDevice: function(dID){
console.log("DeviceGrid::loadDevice -> " + dID);
var store = this.store;
store.load({
params: {
dID: dID
}
});
},
And sorry for my bad english !
Regards,
Shensi