I want to group some fields in a DynamicForm. I have found a way of doing this by creating a ValueManager and defining several small forms that all point to the same ValueManager instance. This works, but I wonder if this is the best way. I know I can also use sections, but this is not giving me the desired look and feel.
Announcement
Collapse
No announcement yet.
X
-
I am indeed using the ValuesManager and define several forms and this works, but it is quite some extra lines to add, because for all these forms I need to set { isGroup: true, padding: 5 }. I've tried creating an GroupedForm class deriving from DynamicForm and only adding these two properties, but somehow this doesn't work. At least I am not seeing a border around the form.
Code:isc.defineClass('GroupedForm', isc.DynamicForm).addProperties({ isGroup: true, padding: 5 });
Comment
-
Via another post, I found out that this will work, but I think that's not nice. One should be able to derive from a (Canvas) class and set isGroup to true without the need to manually set the border and group title.
Code:isc.defineClass('GroupedForm', isc.DynamicForm).addProperties({ isGroup: true, padding: 5, initWidget: function () { this.setBorder(this.groupBorderCSS); this.setGroupTitle(this.groupTitle); this.Super('initWidget', arguments); } });
Comment
-
If the first line in Canvas.setIsGroup would be commented out (but I'm sure it's there for optimization reasons), it will work.
Code:setIsGroup : function (isGroup) { if (isGroup == this.isGroup) return; // ... }
Code:isc.defineClass('GroupedForm', isc.DynamicForm).addProperties({ padding: 5, init: function () { this.Super('init', arguments); this.setIsGroup(true); } });
Comment
Comment