PDA

View Full Version : 2.0.0.000268 - Ext.data.proxy.Server-cfg-extraParams as object



andyboxer
12 Mar 2012, 10:35 PM
I have defined MyAppData singleton with global setting 'channel'

Ext.application({
...
launch: function() {
Ext.define('MyAppData', {
singleton: true,
channel: 'CH01'
});
}
});

This parameter I'd like to set as extraParams (http://docs.sencha.com/ext-js/4-0/#!/api/Ext.data.proxy.Server-cfg-extraParams):

extraParams: {
channel: MyAppData.channel
}

but designer quotes the whole value of extraParams:

extraParams: '{ channel: MyAppData.channel }'

so instead of object I pass each symbol of a string as a separate parameter and as such fail to load data



Please note that this is also valid for the api (http://docs.sencha.com/ext-js/4-0/#!/api/Ext.data.proxy.Server-cfg-api) property and so it is not possible to set values as stated in section "3.1 API" of Ext Direct and Grid Part 2 (http://docs.sencha.com/ext-js/4-0/#!/guide/direct_grid_pt2) tutorial.

aconran
13 Mar 2012, 11:16 AM
We don't yet support variables.

{channel: 124}

Would work fine.

I recommend setting these in an override.

andyboxer
14 Mar 2012, 4:55 AM
Ok, but also it is not possible to correctly set style (http://docs.sencha.com/ext-js/4-0/#!/api/Ext.AbstractComponent-cfg-style):
if I input { border-style: 'solid' } I get

style: '{ border-style: \'solid\' }',

if I remove dash and input { borderstyle: 'solid' } I get

style: {
borderstyle: 'solid'
}

aconran
14 Mar 2012, 8:26 AM
If the left hand side of the object has a - in it, you would need to use quotes around it

Try {"border-style": "solid"}

andyboxer
14 Mar 2012, 9:41 AM
Thanks a lot!

pulliags
14 Mar 2012, 1:08 PM
I don't mean to highjack the thread, but you say you don't support variables yet. I need to pass a LastName and FirstName to a web service using the AjaxProxy. If I hard code the LastName and FirstName in the web service, then I'm able to return the data using the proxy without passing the data. How would I actually pass in the LastName and FirstName from a search screen to the web service using Designer 2.0? Thanks!! Gregg

aconran
14 Mar 2012, 3:38 PM
Gregg you can implement this via an override and/or provide this behavior when a user clicks/taps something like a Button to login.

pulliags
14 Mar 2012, 4:06 PM
Gregg you can implement this via an override and/or provide this behavior when a user clicks/taps something like a Button to login.

Aaron, that's exactly what I'm looking for, but I don't have enough experience with Sencha Designer 2.0 to know where to begin. I've set up the proxy, but I don't know how to set up the button or how to pass the params to my web service. Are there any examples out there that would show how to do this? Thanks so much for taking the time to respond.

pulliags
14 Mar 2012, 4:59 PM
Aaron, just wanted to add a couple of things. What you suggest with a button is exactly what I'm trying to do. I have two text boxes for the user to enter data and a button to submit the data...What I need to do is take this data and pass it to a web service which will then return data to populate a list. I've followed the "Working With Data in Sencha Designer" by Jason Johnston...it's a great little tutorial, but it works with a file on your localhost. I need to be able to accept data from the user and pass that data as parameters to my web service. I did a test using the web service by hard coding parameters on the web service end and everything worked fine in Sencha Designer...it's just trying to get the parameters from text boxes to the web service I'm having trouble with. Really just wish there was a tutorial out there like the one Jason did that addressed this. Any help in the right direction would be appreciated. Thanks!! Gregg

aconran
15 Mar 2012, 6:49 AM
Really just wish there was a tutorial out there like the one Jason did that addressed this.

This is a great idea for a tutorial.

Have you checked out Phil Strong's CityBars tutorial with Designer? This shows calling the Yelp API and passing additional params.
http://www.sencha.com/forum/showthread.php?180014-CityBars-Example-A-first-look-at-Designer-2

pulliags
15 Mar 2012, 6:52 AM
Thanks Aaron!! That will be a great help...appears to be exactly what I need. May take me a while to work though it, but should enlighten me.