PDA

View Full Version : [CLOSED] GridFilters issue in Treepanel



ADV
Sep 16, 2016, 11:10 PM
Hi,
if I add to Treepanel the GridFilters feature I get a javascritpt error.


Below your example http://examples2.ext.net/#/TreePanel/Advanced/TreeGrid/
with GridFilters.



<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>

<html>
<head id="Head1" runat="server">
<title>TreeGrid - Ext.NET Examples</title>

<link href="/resources/css/examples.css" rel="stylesheet" />

<script>
var formatHours = function (v) {
if (v < 1) {
return Math.round(v * 60) + " mins";
} else if (Math.floor(v) !== v) {
var min = v - Math.floor(v);
return Math.floor(v) + "h " + Math.round(min * 60) + "m";
} else {
return v + " hour" + (v === 1 ? "" : "s");
}
};

var handler = function (grid, rowIndex, colIndex, actionItem, event, record, row) {
Ext.Msg.alert('Editing' + (record.get('done') ? ' completed task' : ''), record.get('task'));
};
</script>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />

<h1>
TreeGrid Example
</h1>
<br />

<ext:TreePanel ID="TreePanel1"
runat="server"
Title="Core Team Projects"
Width="500"
Height="300"
Collapsible="true"
UseArrows="true"
RootVisible="false"
MultiSelect="true"
SingleExpand="true"
FolderSort="true">
<Fields>
<ext:ModelField Name="task" />
<ext:ModelField Name="user" />
<ext:ModelField Name="duration" />
<ext:ModelField Name="done" Type="Boolean" />
</Fields>
<ColumnModel>
<Columns>
<ext:TreeColumn ID="TreeColumn1"
runat="server"
Text="Task"
Flex="2"
Sortable="true"
DataIndex="task" />
<ext:TemplateColumn ID="TemplateColumn1"
runat="server"
Text="Duration"
Flex="1"
Sortable="true"
DataIndex="duration"
Align="Center">
<Template ID="Template1" runat="server">
<Html>
{duration:this.formatHours}
</Html>
<Functions>
<ext:JFunction Name="formatHours" Fn="formatHours" />
</Functions>
</Template>
</ext:TemplateColumn>
<ext:Column ID="Column1"
runat="server"
Text="Assigned To"
Flex="1"
Sortable="true"
DataIndex="user" />
<ext:CheckColumn ID="CheckColumn1" runat="server"
Text="Done"
DataIndex="done"
Width="40"
Editable="true"
StopSelection="false" />
<ext:ActionColumn ID="ActionColumn1" runat="server"
Text="Edit"
Width="40"
MenuDisabled="true"
Align="Center">
<Items>
<ext:ActionItem Tooltip="Edit task" Icon="PageWhiteEdit" Handler="handler">
<IsDisabled Handler="return !record.data.leaf;" />
</ext:ActionItem>
</Items>
</ext:ActionColumn>
</Columns>

</ColumnModel>

<Root>
<ext:Node Text="Tasks">
<Children>
<ext:Node Icon="Folder" Expanded="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Project: Shopping" Mode="Value" />
<ext:ConfigItem Name="duration" Value="13.25" />
<ext:ConfigItem Name="user" Value="Clark Lewis" Mode="Value" />
</CustomAttributes>
<Children>
<ext:Node Icon="Folder">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Housewares" Mode="Value" />
<ext:ConfigItem Name="duration" Value="1.25" />
<ext:ConfigItem Name="user" Value="Clark Lewis" Mode="Value" />
</CustomAttributes>
<Children>
<ext:Node Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Kitchen supplies" Mode="Value" />
<ext:ConfigItem Name="duration" Value="0.25" />
<ext:ConfigItem Name="user" Value="Clark Lewis" Mode="Value" />
</CustomAttributes>
</ext:Node>
<ext:Node Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Groceries" Mode="Value" />
<ext:ConfigItem Name="duration" Value="0.4" />
<ext:ConfigItem Name="user" Value="Clark Lewis" Mode="Value" />
<ext:ConfigItem Name="done" Value="true" Mode="Raw" />
</CustomAttributes>
</ext:Node>
<ext:Node Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Cleaning supplies" Mode="Value" />
<ext:ConfigItem Name="duration" Value="0.4" />
<ext:ConfigItem Name="user" Value="Clark Lewis" Mode="Value" />
</CustomAttributes>
</ext:Node>
<ext:Node Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Office supplies" Mode="Value" />
<ext:ConfigItem Name="duration" Value="0.2" />
<ext:ConfigItem Name="user" Value="Clark Lewis" Mode="Value" />
</CustomAttributes>
</ext:Node>
</Children>
</ext:Node>
<ext:Node Icon="Folder" Expanded="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Remodeling" Mode="Value" />
<ext:ConfigItem Name="duration" Value="12" />
<ext:ConfigItem Name="user" Value="Clark Lewis" Mode="Value" />
</CustomAttributes>
<Children>
<ext:Node Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Retile kitchen" Mode="Value" />
<ext:ConfigItem Name="duration" Value="6.5" />
<ext:ConfigItem Name="user" Value="Clark Lewis" Mode="Value" />
</CustomAttributes>
</ext:Node>
<ext:Node Icon="Folder">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Paint bedroom" Mode="Value" />
<ext:ConfigItem Name="duration" Value="2.75" />
<ext:ConfigItem Name="user" Value="Clark Lewis" Mode="Value" />
</CustomAttributes>
<Children>
<ext:Node Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Ceiling" Mode="Value" />
<ext:ConfigItem Name="duration" Value="1.25" />
<ext:ConfigItem Name="user" Value="Clark Lewis" Mode="Value" />
</CustomAttributes>
</ext:Node>
<ext:Node Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Walls" Mode="Value" />
<ext:ConfigItem Name="duration" Value="1.5" />
<ext:ConfigItem Name="user" Value="Clark Lewis" Mode="Value" />
</CustomAttributes>
</ext:Node>
</Children>
</ext:Node>
<ext:Node Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Decorate living room" Mode="Value" />
<ext:ConfigItem Name="duration" Value="2.75" />
<ext:ConfigItem Name="user" Value="Clark Lewis" Mode="Value" />
<ext:ConfigItem Name="done" Value="true" Mode="Raw" />
</CustomAttributes>
</ext:Node>
<ext:Node Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Fix lights" Mode="Value" />
<ext:ConfigItem Name="duration" Value="0.75" />
<ext:ConfigItem Name="user" Value="Clark Lewis" Mode="Value" />
<ext:ConfigItem Name="done" Value="true" Mode="Raw" />
</CustomAttributes>
</ext:Node>
<ext:Node Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Reattach screen door" Mode="Value" />
<ext:ConfigItem Name="duration" Value="2" />
<ext:ConfigItem Name="user" Value="Clark Lewis" Mode="Value" />
</CustomAttributes>
</ext:Node>
</Children>
</ext:Node>
</Children>
</ext:Node>
<ext:Node Icon="Folder">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Project: Testing" Mode="Value" />
<ext:ConfigItem Name="duration" Value="2" />
<ext:ConfigItem Name="user" Value="Core Team" Mode="Value" />
</CustomAttributes>
<Children>
<ext:Node Icon="Folder">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Mac OSX" Mode="Value" />
<ext:ConfigItem Name="duration" Value="0.75" />
<ext:ConfigItem Name="user" Value="Clark Lewis" Mode="Value" />
</CustomAttributes>
<Children>
<ext:Node Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="FireFox" Mode="Value" />
<ext:ConfigItem Name="duration" Value="0.25" />
<ext:ConfigItem Name="user" Value="Clark Lewis" Mode="Value" />
</CustomAttributes>
</ext:Node>
<ext:Node Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Safari" Mode="Value" />
<ext:ConfigItem Name="duration" Value="0.25" />
<ext:ConfigItem Name="user" Value="Clark Lewis" Mode="Value" />
</CustomAttributes>
</ext:Node>
<ext:Node Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Chrome" Mode="Value" />
<ext:ConfigItem Name="duration" Value="0.25" />
<ext:ConfigItem Name="user" Value="Clark Lewis" Mode="Value" />
</CustomAttributes>
</ext:Node>
</Children>
</ext:Node>
<ext:Node Icon="Folder">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Windows" Mode="Value" />
<ext:ConfigItem Name="duration" Value="3.75" />
<ext:ConfigItem Name="user" Value="Darrell Meyer" Mode="Value" />
</CustomAttributes>
<Children>
<ext:Node Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="FireFox" Mode="Value" />
<ext:ConfigItem Name="duration" Value="0.25" />
<ext:ConfigItem Name="user" Value="Darrell Meyer" Mode="Value" />
</CustomAttributes>
</ext:Node>
<ext:Node Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Safari" Mode="Value" />
<ext:ConfigItem Name="duration" Value="0.25" />
<ext:ConfigItem Name="user" Value="Darrell Meyer" Mode="Value" />
</CustomAttributes>
</ext:Node>
<ext:Node Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Chrome" Mode="Value" />
<ext:ConfigItem Name="duration" Value="0.25" />
<ext:ConfigItem Name="user" Value="Darrell Meyer" Mode="Value" />
</CustomAttributes>
</ext:Node>
<ext:Node Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Internet Explorer" Mode="Value" />
<ext:ConfigItem Name="duration" Value="3" />
<ext:ConfigItem Name="user" Value="Darrell Meyer" Mode="Value" />
</CustomAttributes>
</ext:Node>
</Children>
</ext:Node>
<ext:Node Icon="Folder">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Linux" Mode="Value" />
<ext:ConfigItem Name="duration" Value="0.5" />
<ext:ConfigItem Name="user" Value="Steve Scott" Mode="Value" />
</CustomAttributes>
<Children>
<ext:Node Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="FireFox" Mode="Value" />
<ext:ConfigItem Name="duration" Value="0.25" />
<ext:ConfigItem Name="user" Value="Steve Scott" Mode="Value" />
</CustomAttributes>
</ext:Node>
<ext:Node Leaf="true">
<CustomAttributes>
<ext:ConfigItem Name="task" Value="Chrome" Mode="Value" />
<ext:ConfigItem Name="duration" Value="0.25" />
<ext:ConfigItem Name="user" Value="Steve Scott" Mode="Value" />
</CustomAttributes>
</ext:Node>
</Children>
</ext:Node>
</Children>
</ext:Node>
</Children>
</ext:Node>
</Root>

<Features>
<ext:GridFilters runat="server" ID="GridFilters4" Local="true">
<Filters>
<ext:StringFilter DataIndex="user" />
</Filters>
</ext:GridFilters>
</Features>


</ext:TreePanel>
</form>
</body>
</html>



Any idea?

fabricio.murta
Sep 17, 2016, 1:52 AM
Hello @ADV!

This answer from Vladimir is still actual: TreeGrid Filters - Plugins - Post 2 (http://forums.ext.net/showthread.php?7512&p=29894&viewfull=1#post29894).

In short, the GridFilters plugin is written for GridPanels and is not supposed to work on TreePanels at all.

fabricio.murta
Oct 10, 2016, 8:18 PM
Hello @ADV!

It has been more than a week and no feedback on this thread. Do you still need assistance on this issue? If still no reply for another week, we'll mark this as closed -- which won't prevent you from posting follow-ups afterwards anyway.