-
- 375 Posts
Quote from: lossendae at May 24, 2011, 04:54 PMThat's why i asked, the doodle example does not use the right method to add components to the page using extjs layout border.
Instead of using MODx.load(), try the following:
content = Ext.getCmp("modx-content");
var YourComponent = new MODx.YourCompoent();
content.removeAll();
content.add(YourComponent );
content.doLayout();
Now, in don't remember well, but old Doodle used a landing div of your choice to rendrer your CMP (renderTo: 'your_div'). Since the content is directly handled by the main layout, you have to remove those if you use the above method.
Hi lossendae,
this is a good hint! And it's the only hint I could find in the forums regarding your more "modern" method of adding components to a CMP. The problem is - as a beginner it's very hard for me to figure out where to put this code and what to change from the myExtra tutorial (or the Doodles tut).
I had a look at nearly a dozen of well known MODx extras - and they all use the "old" method.
Do I ask for too much if I ask you to give us a little more details on how to change the doodles tutorial to use the "better" method?
Maybe you could enlighten us?
Thanks,
Martin