-
18 Sep 2012 7:40 AM #1
How to use the Ext.ux.form.field.MultiMonth component in Architect 2.1 ?
How to use the Ext.ux.form.field.MultiMonth component in Architect 2.1 ?
Hello,
I'm trying to use the Ext.ux.form.field.MultiMonth component available at https://market.sencha.com/users/30/extensions/61 in Sencha Architect, but I cannot get it to work. It doesn't even come in .xdc format so I can't add it to the toolbox.
Is there a way to add the component to the toolbox, so that I could drag n drop it where I need?
In my application, I did the following:
Added a Loader and a "requires" section:
"lib/extjs_plugins/ux" being the path of the "ux" directory relative to the root of my Sencha Architect application.Code:Ext.Loader.setConfig({ enabled: true, paths: { Ext: '.', 'Ext.ux': 'lib/extjs_plugins/ux' } }); Ext.application({ requires: [ 'Ext.ux.form.field.MultiMonth' ], [...] );
However I still cannot add the component to any container. It seems to be invisible although the browser dev tools show that the component files are found and loaded.
Any help would be very appreciated, and a minimal and working example would be better again.
Best regards,
Gabriel
-
19 Sep 2012 2:05 AM #2
I'd really like an answer here. I found a workaround, but it is more of a hack than a solution, so if there is a better solution, I'll be happy to hear it.
Here is my hack:- Add a container in the Views node
- Set the container's "userClassName" config to "MultiMonthContainer"
- Set the MultiMonthContainer's "userAlias" config to "multimonthcontainer"
- Delete the MultiMonthContainer's "width" and "height" configs
- Ensure that MultiMonthContainer's layout is set to "auto"
- Jump to MultiMonthContainer'scode view
- Click on the "Create Override" button
- Added the following "initComponent" function after the "override" config:
And finally I can drag and drop the "MultiMonthContainer" container to where I want to use it and select the "Link" button when asked.Code:initComponent: function() { var me = this; Ext.applyIf(me, { items: [ { xtype: 'multimonthfield', fieldLabel: 'Période', labelAlign: 'top', labelSeparator: ' :', format: 'M Y', displayRangeSeparator: " à ", rangeSeparatorRE: /\s*à\s*/, startingMonthText: "Mois début", endingMonthText: "Mois fin", okText: "OK", cancelText: "Annuler", clearText: "Réinitialiser" } ] }); me.callParent(arguments); }
Note that the MultiMonth field is not rendered in Architect, nor can I modify its config in the Config pane. So that's not convenient at all.Last edited by dnoizet; 19 Sep 2012 at 3:32 AM. Reason: fixed grammar
-
21 Sep 2012 5:09 AM #3
I would really, *really* like to have someone's advice on this, if that's not too much to ask. How to use components from the Sencha Market in Sancha Architect, anyway?
-
5 Oct 2012 1:10 AM #4


Reply With Quote