ExtJS: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 36: | Line 36: | ||
cd ui.mob;sencha app build;\ | cd ui.mob;sencha app build;\ | ||
sencha web start | sencha web start | ||
</source> | |||
==Remote REST== | |||
<source lang="js"> | |||
Ext.define( 'CKo.store.m00.sm.M00SM00X00', { | |||
extend: 'Ext.data.Store', | |||
model : 'CKo.model.m00.mm.M00MM00X00', | |||
autoLoad : false, | |||
remoteSort : true, | |||
remoteFilter: true, | |||
autoSync : true, | |||
proxy : { | |||
type: 'rest', | |||
api : { | |||
create : 'https://dev.chorke.org/m/00/cm/00/x/00', //M00CM00X00 | |||
read : 'https://dev.chorke.org/m/00/cm/00/x/00', //M00CM00X00 | |||
update : 'https://dev.chorke.org/m/00/cm/00/x/00', //M00CM00X00 | |||
destroy: 'https://dev.chorke.org/m/00/cm/00/x/00' //M00CM00X00 | |||
}, | |||
actionMethods: { | |||
create : 'POST', | |||
read : 'GET', | |||
update : 'PUT', | |||
destroy: 'DELETE' | |||
}, | |||
reader: { | |||
type: 'json', | |||
root: 'data', | |||
successProperty: 'success' | |||
}, | |||
writer: { | |||
type: 'json', | |||
root: 'data' | |||
} | |||
} | |||
}); | |||
</source> | </source> | ||
Revision as of 20:35, 3 November 2019
Optionally
# using classic toolkit for web application
# sencha -sdk /opt/sdk/extjs/ext-6.2.0-gpl generate app -classic Web ./ui.web
sencha -sdk /d/opt/sdk/extjs/ext-6.2.0-gpl generate app -classic Web ./ui.web
sed -i 's/"theme": "theme-triton"/"theme": "theme-crisp"/g' ./ui.web/app.json
#cd ui.web;sencha app build --clean --environment development
#cd ui.web;sencha app build --clean --environment production
cd ui.web;sencha app build
#sencha app refresh
#sencha app watch
sencha web start
# using modern toolkit for mobile application
# sencha -sdk /opt/sdk/extjs/ext-6.2.0-gpl generate app -modern Mob ./ui.mob
sencha -sdk /d/opt/sdk/extjs/ext-6.2.0-gpl generate app -modern Mob ./ui.mob
sed -i 's/"theme": "theme-triton"/"theme": "theme-ios"/g' ./ui.mob/app.json
#cd ui.mob;sencha app build --clean --environment development
#cd ui.mob;sencha app build --clean --environment production
cd ui.mob;sencha app build
#sencha app refresh
#sencha app watch
sencha web start
Simplified
# using classic toolkit for web application
sencha -sdk /d/opt/sdk/extjs/ext-6.2.0-gpl generate app -classic Web ./ui.web;\
cd ui.web;sencha app build;\
sencha web start
# using modern toolkit for mobile application
sencha -sdk /d/opt/sdk/extjs/ext-6.2.0-gpl generate app -modern Mob ./ui.mob;\
sed -i 's/"theme": "theme-triton"/"theme": "theme-ios"/g' ./ui.mob/app.json;\
cd ui.mob;sencha app build;\
sencha web start
Remote REST
Ext.define( 'CKo.store.m00.sm.M00SM00X00', {
extend: 'Ext.data.Store',
model : 'CKo.model.m00.mm.M00MM00X00',
autoLoad : false,
remoteSort : true,
remoteFilter: true,
autoSync : true,
proxy : {
type: 'rest',
api : {
create : 'https://dev.chorke.org/m/00/cm/00/x/00', //M00CM00X00
read : 'https://dev.chorke.org/m/00/cm/00/x/00', //M00CM00X00
update : 'https://dev.chorke.org/m/00/cm/00/x/00', //M00CM00X00
destroy: 'https://dev.chorke.org/m/00/cm/00/x/00' //M00CM00X00
},
actionMethods: {
create : 'POST',
read : 'GET',
update : 'PUT',
destroy: 'DELETE'
},
reader: {
type: 'json',
root: 'data',
successProperty: 'success'
},
writer: {
type: 'json',
root: 'data'
}
}
});
Component
|
|