PDA

View Full Version : [CLOSED] Migrating to 2: Javascript code issues



PhilG
May 21, 2012, 9:31 AM
Hi,

I'm getting a lot of issues in the code I'm trying to migrate to ext.net 2 with reference errors caused by namespace issues. For example, I have a menu that contains this click handler:



<ext:MenuItem Text="Edit Site" Icon="BuildingEdit">
<Listeners>
<Click Handler="var win = SiteDetailsWindow; win.autoLoad.params.id = #{TreePanel1}.menuNode.actualId; win.show();" />
</Listeners>
</ext:MenuItem>


I've changed the Resourcemanager to this:



<ext:ResourceManager ID="ResourceManager1" runat="server" IDMode="Explicit" NameSpace=""/>


But when I run, I get a JS error - Uncaught ReferenceError: MainContent_MainPanel_TreePanel1 is not defined. That JS error is when the page loads - it stops the UI from rendering.

Is this related to where I am adding the click hander code, or is there something else I need to do with ext.net 2?

Thanks

Vladimir
May 21, 2012, 10:48 AM
Hi,

Please post test case

PhilG
May 21, 2012, 10:50 AM
Hi,

Please post test case

I'll try to get one together for you - it happens in a lot of places so I was wondering if there was a general rule change about referencing Ext.net components in javascript..

Vladimir
May 21, 2012, 10:54 AM
Well, empty value for Namespace should be enough to prevent any namespace
If you have issue with empty namespace then please post a sample

Vladimir
May 21, 2012, 11:01 AM
By the way, did you set up empty namespace on the same page where TreePanel
If you set emptynamespace in web.config then is the issue still persisted?