Hi Kedar,
at CoreMedia, we apply Jangaroo to build UIs with Ext JS, so I can
tell
you doing so actually works, even for large scale projects.
Jangaroo's Ext AS / EXML was inspired by Flex, so EXML is quite
similar
to MXML.
Actually, when migrating to Ext 4 (we still use Ext JS 3.4), we think
about extending Jangaroo to support MXML instead of EXML.
On Feb 28, 2:04 pm, Kedar Dixit <
dixitke...@gmail.com> wrote:
> My questions are as below:
> 1. If I have existing Flex code (that does NOT implement the EXT JS AS
> API), is there a way to still convert this into ExtJS? (maybe define a EXML
> that bridges the gap?
Jangaroo supports ActionScript, and Flex is completely written in
ActionScript.
So one could think it should be possible to compile Flex with Jangaroo
and
end up with Flex targeting JavaScript / HTML5. But this is not so
easy, since
Jangaroo does not implement all language features of ActionScript
(e.g. E4X
is missing) and it does not fully implement the Flash API, which is
used
extensively by Flex. Even if it would, the result would most likely be
megabytes
of JavaScript code---too bloated for a UI framework running in the
browser.
So your approach to use Ext JS components instead of Flex components
is much more realistic. For some disclaimers, see below.
> Has anyone tried this? Can you please share sample code if they have done
> it?
The only sample code publicly available are the examples from the
Github project
described on the Wiki page you mention. It you have not yet played
around
with these, you should really go ahead and clone this stuff:
https://github.com/CoreMedia/jangaroo-ext-as-examples
If you have trouble getting it to work, feel free to post here again!
> 2. Also, does it work when you have the declarative flex code (mxml instead
> of .as. I understand mxml is complied into an .as that then is written into
> fbc, but will the conversion to ExtJS work with .mxml files as well?)
EXML, like MXML, is another syntax to implement ActionScript classes.
You could tell the original mxmlc to keep the generated ActionScript
code
and compile that code with Jangaroo, but it uses too large parts of
the
Flex API and you cannot tell mxmlc to not generate Flash code, so this
is not the way to go. Currently, I'd recommend porting your
application to
EXML.
The examples show you in a step-by-step way how you can use Ext JS
from
pure ActionScript code and how you can combine this with declarative
code
written in EXML. So with some effort, it should be possible to convert
your
MXML code into EXML, using the Ext components corresponding to the
Flex
components your code uses. Be aware that some components and concepts
are quite different in Ext than in Flex. For example, in Ext, there is
no general
"repeater" component and no automatic property-binding (Flex:
[Bindable]).
Greetings
-Frank-