[CLOSED] js error btn undefined after destroy() of container?

  1. #1

    [CLOSED] js error btn undefined after destroy() of container?

    Hi,
    I've this code written in v1.6 and working just fine there:
    Ext.Net.X.Js.AddScript(panelToClear.Items[0].ClientID+".destroy();");
    In v2.2 there is an error : TypeError: App.ctl00_siteContent_container1_btn is undefined
    Is there a difference in v2.2 of name this destroy(); method of ext JS?

    I do this when I change a tabs in TabPanel control for loading dynamically control inherited by Ext.Net.Container it's main requirement in my application.

    Thanks,
    ViDom
    Last edited by Daniil; May 21, 2013 at 2:25 PM. Reason: [CLOSED]
  2. #2
    Hi @ViDom,

    Interesting. Does this work?
    panelToClear.Items[0].Destroy();
    If it doesn't, please provide a test case.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @ViDom,

    Interesting. Does this work?
    panelToClear.Items[0].Destroy();
    If it doesn't, please provide a test case.
    This:
    panelToClear.Items[0].ClientID.Destroy();
    this item looks like on this mockup:
    Click image for larger version. 

Name:	mockup-control.png 
Views:	12 
Size:	4.9 KB 
ID:	6238

    worked for sure in v1.6.
    If I remember correctly you @Daniil have advised me this for older version on forum ;)

    In v2.2 there is no error like: destroy is undefined so I assumed it work.

    Hope it's enough information for get help if not I'll need more time for make test case.
  4. #4
    Unfortunately, the mockup doesn't help me to reproduce it or understand why it happens.

    In v2.2 there is no error like: destroy is undefined so I assumed it work.
    Well, yes, but there is an error:
    TypeError: App.ctl00_siteContent_container1_btn is undefined
    It means that "App.ctl00_siteContent_container1_btn" doesn't refer a Button client side instance. Hard to say why.
  5. #5
    Quote Originally Posted by Daniil View Post
    Unfortunately, the mockup doesn't help me to reproduce it or understand why it happens.



    Well, yes, but there is an error:
    TypeError: App.ctl00_siteContent_container1_btn is undefined
    It means that "App.ctl00_siteContent_container1_btn" doesn't refer a Button client side instance. Hard to say why.
    Ok, I'm on making test case for reproduce.
  6. #6
    Quote Originally Posted by ViDom View Post
    Ok, I'm on making test case for reproduce.
    In test case I was unable to reproduce js error for now in simple example.
    Last edited by ViDom; May 20, 2013 at 9:47 AM.
  7. #7
    Hello!

    Try to add functionality from your application to the simple example to understand what exactly causes this issue. Without test case it's difficult to say something certain.
  8. #8
    Quote Originally Posted by Baidaly View Post
    Hello!

    Try to add functionality from your application to the simple example to understand what exactly causes this issue. Without test case it's difficult to say something certain.
    Ok. If I remove this :
    Ext.Net.X.Js.AddScript(panelToClear.Items[0].ClientID+".destroy();");
    from code there is no more js error. But I've certain requirement. Need to make loaded 1 tab at time rest of them (in this moment last active should be clear from any items existing inside of this oldTab). Could you please tell me how should I do that in v2.2 ?
  9. #9
    It looks to be a candidate for a new forum thread. Please start.

Similar Threads

  1. [OPEN] [#221] Store in Partial View Raises JS Error for Destroy
    By cleve in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 30, 2013, 4:30 AM
  2. Replies: 2
    Last Post: May 08, 2012, 3:34 PM
  3. [CLOSED] Getting error while adding custom control to container
    By AnulekhaK in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 20, 2012, 12:59 PM
  4. Error: Ext is Undefined
    By shankar in forum 1.x Help
    Replies: 2
    Last Post: Aug 05, 2010, 4:00 PM
  5. [CLOSED] [1.0] HtmlEditor js error on destroy
    By jchau in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 20, 2010, 9:09 PM

Tags for this Thread

Posting Permissions