Search code examples
extjsmvvmextjs-mvcgeoext

How can I add GeoExt3 to Extjs 6 MVVM architecture?


I want to develop an Extjs 6 application with MVVM architecture. In this application, I want to use GeoExt 3.

I don't know what to do to add GeoExt 3 library to application?

How can I do it?


Solution

  • You must create a package with GeoExt3. For packaging in Extjs-6 read heer.

    How to package GeoExt using sencha command

    Install sencha cmd from here (tested with the version 6, only as preview right now).

    To generate a package you usually first create a sencha workspace by issuing

    sencha -sdk /path/to/ext-n.n.n generate workspace /path/to/workspace

    Inside of the workspace clone the geoext3 repository into the packages subfolder:

    $ cd /path/to/workspace/packages
    $ git clone https://github.com/KaiVolland/geoext3.git GeoExt3
    $ cd GeoExt3

    Then you can issue

    $ sencha package build

    Alternatively, if your source isn't living inside of a sencha workspace, you can configure the path to a workspace and then build:

    $ sencha config --prop workspace.config.dir=/path/to/workspace/.sencha/workspace then package build

    Adding GeoExt to a local sencha repository

    Initalize the local "GeoExt Contributors" repository:

    $ sencha package repo init -name "GeoExt Contributors" -email "[email protected]"

    Add the package to this

    $ sencha package add D:/xampp/htdocs/ExtProjects/GeoExt3/build/GeoExt/GeoExt.pkg

    create your app as heer.
    To use this package in a sencha app just add "GeoExt" to the "requires"-array in your app.json:

    /**
     * The list of required packages (with optional versions; default is "latest").
     *
     * For example,
     *
     *      "requires": [
     *          "charts"
     *      ]
     */
    "requires": [
        "GeoExt"
    ],
    

    and at the end build app as follow:

    $ sencha app build