PDA

View Full Version : [CLOSED] Disable , hide , and show a tree node from the server side



elbanna23
Feb 17, 2014, 7:05 AM
I'm trying to disable , hide , and show after hiding a tree node from the server side, but I can't find any method to do this.

on a previous editions there were methods for deleting , disabling , showing ;

DisableNode

HideNode

ShowNode


Is there any way to do it with a specific tree node?

Daniil
Feb 17, 2014, 11:28 AM
Hi @elbanna23,

Yes, unfortunately, this functionality is gone.

As for showing/hiding a node, I added the following breaking change item. Please follow the link.

186. The TreePanel's ShowNode and HideNode methods have been removed. The TreeNode's Hidden property has been removed as well.
Please see how to achieve it now: http://forums.ext.net/showthread.php?19505&p=84070&viewfull=1#post84070


As for disabling a node, I added the following breaking change item.

187. The TreePanel's DisableNode method has been removed. The TreeNode's Disabled property has been removed as well.
Please see how to achieve it now: http://forums.ext.net/showthread.php?28092

And here is an example.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>

<script>
Ext.tree.View.override({
processItemEvent: function(record, row, rowIndex, e) {
if (record.data.disabled) {
return false;
}

this.callParent(arguments);
}
});

var getRowClass = function (record, rowIndex) {
if (record.data.disabled) {
return "x-item-disabled";
}
};
</script>

<style>
.x-item-disabled {
opacity: 0.5;
}
</style>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:TreePanel ID="TreePanel1" runat="server">
<Fields>
<ext:ModelField Name="disabled" />
</Fields>
<Root>
<ext:Node Text="Root (level 0)" Expanded="true">
<CustomAttributes>
<ext:ConfigItem Name="disabled" Value="true" Mode="Raw" />
</CustomAttributes>
<Children>
<ext:Node Text="Node1 (level 1)" Expanded="true">
<Children>
<ext:Node Text="Node1 (level 2)" Expanded="true">
<Children>
<ext:Node Text="Node1 (level 3)" Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="disabled" Value="true" Mode="Raw" />
</CustomAttributes>
</ext:Node>
<ext:Node Text="Node2 (level 3)" Leaf="true" />
</Children>
</ext:Node>
</Children>
</ext:Node>
<ext:Node Text="Node2 (level 1)" Expanded="true">
<Children>
<ext:Node Text="Node1 (level 2)" Expanded="true">
<Children>
<ext:Node Text="Node1 (level 3)" Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="disabled" Value="true" Mode="Raw" />
</CustomAttributes>
</ext:Node>
<ext:Node Text="Node2 (level 3)" Leaf="true" />
</Children>
</ext:Node>
</Children>
</ext:Node>
</Children>
</ext:Node>
</Root>
<View>
<ext:TreeView runat="server">
<GetRowClass Fn="getRowClass" />
</ext:TreeView>
</View>
</ext:TreePanel>
</form>
</body>
</html>

elbanna23
Aug 28, 2014, 12:23 PM
Dear Sir
please if you can , try to return the methods for deleting , disabling , showing that were in the previous editions.

cause it was very simple.

thank you in advance

Daniil
Aug 29, 2014, 5:49 AM
I agree with you, it would be nice to have it back. Though, I am not sure they'll be back at this point.