Results 1 to 3 of 3

Thread: Loading ExtJs app.js in Web Worker

  1. #1
    Sencha Premium User
    Join Date
    Mar 2018
    Posts
    1

    Default Loading ExtJs app.js in Web Worker

    Hi all,

    Upon trying to load the app.js file generated by Sencha build we are getting DOM related errors . We tried using virtual dom framework (nodom.js) which helped somewhat but still getting DOM errors (i.e. Cannot read property 'style' of undefined, doc.addEventListener is not a function).

    Code looks something like this inside web worker js file:
    importScripts('ext_microloader.js'); //javascript originally inside microloader html script tag
    importScripts("app.js");

    After these errors (if I run importScript in try-catch) Ext.create fails on attempt to create my CrudManager on line:
    cls = Manager.get(name);
    (inside Ext.apply(Ext, {create:function() {)

    Is there any experience in the community with loading Extjs app.js inside web worker?

    Any suggestions would be highly appreciated.

    Thanks,

    Dan

  2. #2
    Sencha User
    Join Date
    Aug 2017
    Posts
    18
    Answers
    3

    Default

    Hi,

    What are you trying to achieve?.
    Web Workers have no access to the Dom thats why you get all the errors.

    Quote Originally Posted by dannya View Post
    Hi all,

    Upon trying to load the app.js file generated by Sencha build we are getting DOM related errors . We tried using virtual dom framework (nodom.js) which helped somewhat but still getting DOM errors (i.e. Cannot read property 'style' of undefined, doc.addEventListener is not a function).

    Code looks something like this inside web worker js file:
    importScripts('ext_microloader.js'); //javascript originally inside microloader html script tag
    importScripts("app.js");

    After these errors (if I run importScript in try-catch) Ext.create fails on attempt to create my CrudManager on line:
    cls = Manager.get(name);
    (inside Ext.apply(Ext, {create:function() {)

    Is there any experience in the community with loading Extjs app.js inside web worker?

    Any suggestions would be highly appreciated.

    Thanks,

    Dan

  3. #3
    Sencha User
    Join Date
    Aug 2017
    Posts
    18
    Answers
    3

    Default

    Hi,

    What are you trying to achieve?. Workers live in thier own Sandbox all libraries you load cannot be used in the main thread.


    Also, Web Workers have no access to the Dom thats why you get all the errors.

Similar Threads

  1. Web Worker with ExtJS
    By sanketgandhi876 in forum Ext: Q&A
    Replies: 2
    Last Post: 30 Sep 2015, 11:58 PM
  2. Extjs Gantt
    By pnoel in forum Ext 2.x: Help & Discussion
    Replies: 16
    Last Post: 5 Dec 2014, 12:49 AM
  3. Gantt Charts in Extjs 3.4
    By Priya R in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 10 Sep 2012, 5:39 AM
  4. Can I have problems loading all ExtJS scripts inside the BODY tag?
    By pret in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 18 Mar 2011, 1:09 PM
  5. Ext Gantt - A Gantt Charting Component
    By mankz in forum Community Discussion
    Replies: 31
    Last Post: 24 Dec 2010, 10:07 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •