PDA

View Full Version : [CLOSED] Unable to override TreeNodeUI onDblClick



martin.mosimann
Dec 12, 2012, 9:52 AM
Hi,

I'm trying to override the onDblClick event of the TreeNodeUI to disable the expand/collapse behaviour according to the following instructions:
http://forums.ext.net/showthread.php?14264-CLOSED-How-do-I-disable-the-TreePanel-expand-on-double-click

When I use the syntax like it is described in the previous post:


Ext.tree.TreeNodeUI.override({
onDblClick: function (e) {
// custom logic
}
});


I get an error saying:

Microsoft JScript runtime error: Unable to get value of the property 'override': object is null or undefined

When I use the syntax like this:


Ext.override(Ext.tree.TreeNodeUI, {
onDblClick: function (e) {
// custom logic
}
});


I get the following error:

Microsoft JScript runtime error: Unable to get value of the property '$isClass': object is null or undefined


By the way, I'm using Ext.NET 2.1.0 and I've already put an ResourceManager in the body and a ResourcePlaceHolder with Mode=ScriptFiles in the head of the master page.

Doe's anybody know a solution to this problem?

Regards,
Martin

Daniil
Dec 12, 2012, 11:46 AM
Hi Martin,


There is no the TreeNodeUI class in Ext.NET v2 at all.

Please set up:

<ext:TreePanel runat="server">
<View>
<ext:TreeView runat="server">
<CustomConfig>
<ext:ConfigItem Name="ToggleOnDblClick" Value="false" Mode="Raw" />
</CustomConfig>
</ext:TreeView>
</View>
</ext:TreePanel>

or just

<ext:TreeView runat="server" ToggleOnDblClick="false" />
after update from SVN.



By the way, I'm using Ext.NET 2.1.0 and I've already put an ResourceManager in the body and a ResourcePlaceHolder with Mode=ScriptFiles in the head of the master page.


Just for the future: a ResourcePlaceHolder control is not required anymore for such overrides. You can just put a script into a page's <head>.

martin.mosimann
Dec 13, 2012, 6:40 PM
Hi Daniil,

Whow, I didn't expect that it would be that easy. ;-)

It works perfectly!

Thanks a lot for the quick and great answer,
Martin