PDA

View Full Version : MY FIRST SHAREPOINT REST (JSON) to Sencha



rgia
23 Sep 2012, 11:08 AM
I have created my first test "JSON" MS SharePoint 2010 service:

'http://moss.irgia.com/_vti_bin/RestInSPWithDataFromSQL/RestDataFromSQL.svc/GetItem/1'

I can not seem to connect it...I appreciate ANY help:

HERE'S MY MODEL (Below is my model):


Ext.define('App.model.RestTreeTaskDetail', {
extend: 'Ext.data.Model',
config: {
idProperty: 'ID',
autoLoad: false,
fields: [
{ name: 'ID', type: 'int' },
{ name: 'TREE_NUM', type: 'int'},
{ name: 'ID_TASK_MASTER', type: 'int'},
{ name: 'TREE_STATUS_DOMAIN_CODE', type: 'int'},
{ name: 'TREE_STATUS_DOMAIN_VALUE', type: 'string'},
{ name: 'TREE_STATUS_DATE', type: 'date', format: 'd-m-Y'},
{ name: 'SPECIES_DOMAIN_CODE', type: 'int'},
{ name: 'SPECIES_DOMAIN_VALUE', type: 'string'},
{ name: 'RATING', type: 'float'},
{ name: 'TREE_TYPE', type: 'string'},
{ name: 'GROW_SPACE_DOMAIN_CODE', type: 'int'},
{ name: 'GROW_SPACE_DOMAIN_VALUE', type: 'string'},
{ name: 'LAND_USE_DOMAIN_CODE', type: 'int'},
{ name: 'LAND_USE_DOMAIN_VALUE', type: 'string'},
{ name: 'DSH', type: 'int'},
{ name: 'HEIGHT', type: 'int'},
{ name: 'CROWN', type: 'int'},
{ name: 'TRUNK', type: 'int'},
{ name: 'BRANCH', type: 'int'},
{ name: 'TWIG', type: 'int'},
{ name: 'FOLLAGE', type: 'int'},
{ name: 'INSECTS_DISEASE', type: 'int'},
{ name: 'ROOTS', type: 'int'},
{ name: 'CALC_TOTALS', type: 'int'},
{ name: 'CALC_CONDITION', type: 'float'},
{ name: 'AESTHETIC', type: 'int'},
{ name: 'SPECIMENS', type: 'int'},
{ name: 'CONTRIBUTION', type: 'int'},
{ name: 'PLACEMENT', type: 'int'},
{ name: 'TARGET', type: 'int'},
{ name: 'SIZE', type: 'int'},
{ name: 'PROBABILITY', type: 'int'},
{ name: 'CALC_RISK_RATING', type: 'float'},
{ name: 'MULTI_DBH_DOMAIN_CODE', type: 'int'},
{ name: 'MULTI_DBH_DOMAIN_VALUE', type: 'string'},
{ name: 'NUM_STEMS_DOMAIN_CODE', type: 'int'},
{ name: 'NUM_STEMS_DOMAIN_VALUE', type: 'string'},
{ name: 'GRID', type: 'string'},
{ name: 'GUID', type: 'string'},
{ name: 'CALC_TREE_VALUE', type: 'float'},
{ name: 'DESIGNATIONS', type: 'string'}
],
proxy: {
type: 'jsonp',
url: 'http://moss.irgia.com/_vti_bin/RestInSPWithDataFromSQL/RestDataFromSQL.svc/GetItem/1'
}
}
})


---------
HERE'S MY STORE:


Ext.define('App.store.RestTreeTaskDetail', {
extend: 'Ext.data.Store',
alias: 'store.resttreetaskdetail',
config: {
model: 'App.model.RestTreeTaskDetail',
autoSync: false,
autoLoad: false,
proxy: {
type: 'localstorage',
id: 'rgia-sprest'
},
storeId: 'idRestTreeTaskDetail'
}
})

-------------------

ANY SUGGESTIONS ON HOW TO CONNECT THIS TO A FORM/LIST?

jay@moduscreate.com
24 Sep 2012, 8:32 AM
1) Please turn off your caps lock. IT IS CONSIDERED YELLING AND PEOPLE WILL THINK THAT YOU ARE RUDE!

2) Please wrap your code in [code] tags! How would you expect people to read your code if it's not properly formatted?

jay@moduscreate.com
24 Sep 2012, 8:34 AM
You have two conflicting things.
1) If you plan on using a remote JSONP proxy, then define that in your store.

2) You can't mix and match local storage proxies with JSONP. So remove that.

rgia
24 Sep 2012, 9:10 AM
Thank you Jay for both your technical response and corrective protocol help:)

I'm an old-dog trying to learn new tricks.

rgia
24 Sep 2012, 9:12 AM
Jay, i work from home, and have a short window in which to prototype an app...would you be willing to spare 15 minutes to have a phone conversation?

jay@moduscreate.com
24 Sep 2012, 11:44 AM
Unfortunately, not. I am on a tight deadline myself with Sencha Touch in Action among other things like making sure my small business continues to run smoothly. :-\

rgia
24 Sep 2012, 1:26 PM
Thanks for your help...i nailed it thanks to your assistance:)