0

This is what I have tried so far:

Ext.application({ .... // This doesn't do anything }) new Ext.Viewport({ // This throws an error }) 

I know it's recommended to use Sencha Cmd, but I wanna simplify the workflow as the scripts will be used in other context, so please show the way without Sencha Cmd.

P/S: The application I'm working on undertaking an upgrade from version 3.4 to 6.

Edit: I expect Extjs 6 can be used in this way:

<!-- main html --> <script src='ext-all.js' ></script> <script src='app-all.js' ></script> 

As you can see, the way to load application scripts is old school. In app-all.js, I tried the approaches above but none worked. A work around I've used is to init a container with width = 100% and height = 100%.

4
  • You haven't really provided enough context. Commented Jan 24, 2017 at 5:52
  • I have updated the question. I'm not sure if it makes anything clearer Commented Jan 24, 2017 at 6:26
  • What error you get on app launch ? Commented Jan 24, 2017 at 6:45
  • No error, just it doesn't do anything. In v3.4 you got new Ext.Viewport to init the app for inline script, but I haven't found any equivalent in v6. Using new Ext.Viewport does throw an Error though: Ext.Viewport is not a constructor Commented Jan 24, 2017 at 8:29

2 Answers 2

1

I ve found the soultion. Extjs 6 has class at Ext.container.Viewport that will do the job

Sign up to request clarification or add additional context in comments.

Comments

0

You can either specify a "mainView" config in the Ext.application param object like so:

Ext.application({ mainView: 'App.view.main.Main' }); 

This will create the class you've specified there, and apply a viewport plugin to it.

Or, you can use the "launch" template function, like so:

Ext.application({ launch: function() { Ext.create('App.view.main.Main'); } }); 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.