Results 1 to 3 of 3

Thread: Extjs component Not created correctly inside jQuery

  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    3
    Vote Rating
    0
      0  

    Question Extjs component Not created correctly inside jQuery

    Hi all, i use Extjs 4.0.7,

    i need create an ExtJS component object inside jQuery $(function(){}), but it seems that the component is not initialized properly.
    When i change the "$(function())" to the "Ext.onReady()" it executed successfully. Using "Ext.onReady()" is not an option for me because I am trying to load (inject) the page that contains the "Ext.onReady()" dynamically into the <div> tag (not iframe). At first i thought the script should execute as expected, however in actual test run the "Ext.onReady()" was never called at all.

    I tried to debug using chrome, and I found out that when using $(function()) I got this error in file ext-all-debug.js line 41280

    // throw error "Uncaught TypeError: Cannot call method 'setSize' of undefined"
    //the surface is undefined
    this.owner.surface.setSize(width, height);


    while when using Ext.onReady
    ( using non dynamic method to load the page), the "this.onwer.surface" is defined correctly.
    could someone shed a light to resolve this issue?

    thankyou, rasi

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    Why are you mixing the frameworks? Going to be a lot to download.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    3
    Vote Rating
    0
      0  

    Default

    Hi mitchellsimoens,

    I developed a web gui constructor using jquery before i found out about the ExtJS Framework, however if I stopped the current development and start over from scratch using ExtJS framework, it will take a long time to reach the stage where i am at now. So decided to use only some of the ExtJS components such as grid, panel to shorten my GUI component only like grid, panel etc. to support my gui constructor.

    Overall developing using with ExtJS has been a pleasant experience till I found another problem and think the root of the problem due to my attempt to load Extjs file dynamically

    please see the sample page I have created for you,

    this site will loading Ext Js (ext-all-debug.js) dynamically :
    you will see the error when seeing the console form in chrome
    http://devcrash.net/dynamic/

    and this site will loading Ext js static (write directly to the head tag of html) :
    no error found
    http://devcrash.net/static/

    Could you figure out what went wrong ?



    thankyou,
    rasi

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
  •