-
29 May 2012 2:56 PM #1
Unanswered: populate a multiselect field using a web service
Unanswered: populate a multiselect field using a web service
Hi all.
im doing a mobile app using sencha touch1 and i want to populate a multiselect field with my RESTFUL web service made by WCF.
here is my store
my model:Code:Ext.regStore('storeCPT', { model: 'compte', autoLoad: true, proxy: { type: 'scripttag', url: 'http://localhost:8732/cpts/cltID/1234', reader: { type: 'json', } } });
and here is my multiselect field puted into my formCode:Ext.regModel('compte', { fields: ['compteID'] });
and here is the response of my web service when i try it with my chrome browserCode:{ xtype: 'multiselectfield', id: 'cptnumb', label: 'Compte', store : 'storeCPT', displayField : "'compteID'", valueField : "'compteID'", name : "multiselect-picker", itemWidth : 400, itemType : "picker", },
but it load without displaying any thing.Code:[{"client":null,"clientID":"1234","commercant":null,"commerçantID":null,"compteDATEOUVERTURE":"\/Date(1336086000000+0100)\/","compteDATESOLDE":"\/Date(1338309980940+0100)\/","compteID":"67589","compteSOLDE":17495,"compteTOTALCREDIT":100,"compteTOTALDEBTI":3505,"credits":[],"institution":null,"institutionID":null,"operateur":null,"operateurID":null,"transactions":[],"transferts":[],"virements":[]},{"client":null,"clientID":"1234","commercant":null,"commerçantID":null,"compteDATEOUVERTURE":"\/Date(1336086000000+0100)\/","compteDATESOLDE":"\/Date(1336777200000+0100)\/","compteID":"98765","compteSOLDE":19658,"compteTOTALCREDIT":1000,"compteTOTALDEBTI":1234,"credits":[],"institution":null,"institutionID":null,"operateur":null,"operateurID":null,"transactions":[],"transferts":[],"virements":[]}]
can you hel pe please
thank you
-
31 May 2012 3:58 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 433
- Answers
- 3101
You have displayField and valueField set to a string improperly. Notice the double and single quotes you are using:
Should probably just beCode:"'compteID'"
Code:"compteID"
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
31 May 2012 6:05 AM #3
hi. thank you for your reply.
i tried as you say "compteID" but it still the same problem, it's load without displaying any thing.
im using this code to display the multiselectielf with picker as itemtype
Code:Ext.ns("Ext.form.ux.touch"); Ext.form.ux.touch.MultiSelect = Ext.extend(Ext.form.Select, { columns: 2, itemWidth: 200, itemType: "list", multiSelect: true, showComponent: function() { var me = this, itemType = me.itemType, itemPanel; if (itemType === "picker") { me.getPicker().show(); } me.isActive = true; }, }); Ext.reg("multiselectfield", Ext.form.ux.touch.MultiSelect);
i don't know what kind of modification shall i do?
thank you
-
5 Jun 2012 5:52 AM #4
SALAM
try to changetype: 'scripttag', to type: 'ajax',it should work
-
5 Jun 2012 6:39 AM #5


Reply With Quote