View Full Version : [CLOSED] context parsed wrong when editing "object" property
yAdEs
31 Dec 2012, 2:50 AM
REQUIRED INFORMATION
Architect Build tested:
Build: 676
Project Type:
ExtJS 4.1
Description:
I find it's hard to edit any "object" properties in SA2.
When I edit "style" property of a panel, and put something like
{
opacity: '0.8';
background-color: #3d71b8
}
or just
opacity: '0.8';
background-color: #3d71b8
they are all parsed as string in SA2, and get results as
'{\r\n opacity: \'0.8\';\r\n background-color: #3d71b8\r\n}'
or
'opacity: \'0.8\';\r\nbackground-color: #3d71b8'
Steps to reproduce the problem:
As said before
HELPFUL INFORMATION
Operating System:
Win7
aconran
1 Jan 2013, 3:09 PM
The object will have to be a valid JS object.
In the event that you put in an invalid object, like the examples above Sencha Architect will automatically convert it to a string (so that we continue to create valid JS).
Try pasting in:
{
opacity: 0.8,
"background-color": "#3d71b8"
}
background-color needs to be quoted since it has a - in it. And the color needs to be quoted since it has a # in it.
The object will have to be a valid JS object.
In the event that you put in an invalid object, like the examples above Sencha Architect will automatically convert it to a string (so that we continue to create valid JS).
Try pasting in:
{
opacity: 0.8,
"background-color": "#3d71b8"
}
background-color needs to be quoted since it has a - in it. And the color needs to be quoted since it has a # in it.
It works!=D> And sorry for my fault.
yAdEs
2 Jan 2013, 11:29 AM
BTW, plz help me to write such api in the write way, I really get puzzle with it:
api:
{
create :'/controller/new',
read :'/controller/load',
update :'/controller/update',
destroy :'/controller/destroy_action'
}
It's in document of Ext.data.proxy.Server, and I try a lot of way to put them in SA2, but give up at the end.
aconran
2 Jan 2013, 11:32 AM
I just copy/pasted what you have above and worked fine?
jtenney
2 Jan 2013, 11:33 AM
I have tried the following:
new Date()
new Date();
'new Date()'
'new Date();'
all without success. I have also chosen 'object' from the dropdown on the left side. According to the API documentation ith should just be:
new Date()
Very frustrated.
aconran
2 Jan 2013, 11:43 AM
Setup things that use JS expressions in event handlers.
http://www.sencha.com/forum/showthread.php?240565-when-setting-min-max-value-of-Date-Field-new-Date()-is-formatted-as-a-string&p=882465&viewfull=1#post882465
yAdEs
2 Jan 2013, 11:18 PM
I just copy/pasted what you have above and worked fine?
I don't know why, but it just doesn't work well.
I paste like this,
41052
and got such result.....
41053
Finally it's solved :
{
create : 'office/user/create',
read : 'office/user/read',
update : 'office/user/update',
destroy : 'office/user/destroy'
}
Need bracket inside:(.
It's a little hard for user
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.