View Full Version : [DUP] Custom property weird truncation

9 Mar 2012, 9:31 PM
When setting a custom property on any component (i.e.: Store), if a line is longer than width of free-form textfield, it will truncate / strip out white spaces.

Example scenario:

1. Create a Store.

2. Add custom property "grouper".

3. Add the following into the value of grouper:

groupFn: function(record) {
return record.get('last_name').substr(0, 1);
sortProperty: 'last_name'

4. Generated code becomes:

grouper: {
groupFn: function(record){
sortProperty: 'last_name'

Also ... is there a nicer way to put in custom properties into components? The textbox is really tiny, and doesn't always treat the text I put into the box as "code", and instead it tries to convert it into a String:


custom_value = { something: this.someMethod('xx') }


custom_value: '{\nsomething: this.someMethod(\'xx\')\n}'

It's my first post, so I apologize if I'm not posting it right. Let me know if I should be posting both of the above issues separately or if I should be posting differently and I'll learn quick!

10 Mar 2012, 6:21 PM

You can add grouper from toolbox to the store and configure the groupFn config for the grouper.
So you dont need a custom property.

You bring up a good point of having better editor for custom properties and we will look into it.

I will create a bug so that formatting for the function is handled correctly.

Regarding "custom_value = { something: this.someMethod('xx') }"
ensure this.someMethod can be resolved else it will be converted to string.


10 Mar 2012, 8:35 PM
Thanks for the guidance, bharatn!

You guys did a great job at improving Designer and adding so many new things that I completely missed it. Thanks for pointing me to it.


custom_value = { something: this.someMethod('xx') }

... would it be at all possible to not have that "intelligence" and instead allow the developer to choose explicitly that they want something to be a string?

Just a thought.

Good job on the Designer so far.