PDA

View Full Version : [OPEN] Unable to add custom object (listConfig) - quotes are added



pblanchardie
8 Oct 2012, 7:11 AM
REQUIRED INFORMATION




Architect Build tested:

Build: 640



Project Type:

ExtJS 4.x



Description:

When I add a "listConfig" custom propery to a combobox, select "Object" as the type, the object code is treated like a String by architect: quotes are added and new-lines get replaced by \r\n.



Steps to reproduce the problem:
add a "listConfig" custom propery to a combobox, select "Object" as the type, then write code


The result that was expected:
the code as it were typed as the value of the property


The result that occurs instead:
a string


HELPFUL INFORMATION




Screenshot, Project, or Video:


Possible fix:


Operating System:

Phil.Strong
9 Oct 2012, 10:47 AM
Objects get stringified when they don't evaluate to real objects. In future version of Architect we do a better job of telling you this but for now it being a string and not an object is the only indication.

Objects should all be surrounded by curly braces
{
...
}

for instance
{
a: 1

note there is no ending curly brace would be stringified

pblanchardie
10 Oct 2012, 3:26 AM
Hi

Objects get stringified even when they are real objects, and surrounded with {}

Try with that, and you'll see the bug:


{
loadingText:i18n.patient_searching,
emptyText:i18n.patient_empty_result,


// Custom rendering template for each item
getInnerTpl:function () {
return '[{userName}] {lastName} {firstName} ';
}
}


Regards

aconran
11 Oct 2012, 10:38 AM
Raw JavaScript references variables etc are not possible at this time. They must be implemented via overrides. We are aware of this and working to fix it in the next minor version.