[CLOSED] [1.0] TreeGridBooleanColumn

  1. #1

    [CLOSED] [1.0] TreeGridBooleanColumn

    Hi all,

    can you verify the code below? Is that a bug or wrong code. Please, see TreeGridBooleanColumn and relative ConfigItem.
    It gives me js Constructor error. Didn't try TreeGridDateColumn and TreeGridNumberColumn.

    
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head2" runat="server">
        <title>TreeGrid - Ext.NET Examples</title>
        <link href="../../../../resources/css/examples.css" rel="stylesheet" type="text/css" />
    
        <script type="text/javascript">
            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");
                }
            };
        </script>
    
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <h1>
            TreeGrid</h1>
        <ext:TreeGrid runat="server" Title="Core Team Projects" Width="500" Height="300"
            EnableDD="true">
            <Columns>
                <ext:TreeGridColumn Header="Task" Width="230" DataIndex="Task" />
                <ext:TreeGridColumn Header="Duration" Width="100" DataIndex="Duration" Align="Center"
                    SortType="AsFloat">
                    <XTemplate runat="server">
                        <Html>
                                {Duration:this.formatHours}
                            </Html>
                        <Functions>
                            <ext:JFunction Name="formatHours" Fn="formatHours" />
                        </Functions>
                    </XTemplate>
                </ext:TreeGridColumn>
                <ext:TreeGridColumn Header="Assigned To" Width="150" DataIndex="User" />
                <ext:TreeGridBooleanColumn Header="Visible" DataIndex="Visible" Width="100" />
            </Columns>
            <Root>
                <ext:TreeNode Text="Tasks">
                    <Nodes>
                        <ext:TreeNode Icon="Folder" Expanded="true">
                            <CustomAttributes>
                                <ext:ConfigItem Name="Task" Value="Project: Shopping" Mode="Value" />
                                <ext:ConfigItem Name="Duration" Value="13.25" Mode="Raw" />
                                <ext:ConfigItem Name="User" Value="Tommy Maintz" Mode="Value" />
                                <ext:ConfigItem Name="Visible" Value="true" Mode="Value" />
                            </CustomAttributes>
                            <Nodes>
                                <ext:TreeNode Icon="Folder">
                                    <CustomAttributes>
                                        <ext:ConfigItem Name="Task" Value="Housewares" Mode="Value" />
                                        <ext:ConfigItem Name="Duration" Value="1.25" Mode="Raw" />
                                        <ext:ConfigItem Name="User" Value="Tommy Maintz" Mode="Value" />
                                        <ext:ConfigItem Name="Visible" Value="false" Mode="Value"  />
                                    </CustomAttributes>
                                    <Nodes>
                                        <ext:TreeNode Leaf="true">
                                            <CustomAttributes>
                                                <ext:ConfigItem Name="Task" Value="Kitchen supplies" Mode="Value" />
                                                <ext:ConfigItem Name="Duration" Value="0.25" Mode="Raw" />
                                                <ext:ConfigItem Name="User" Value="Tommy Maintz" Mode="Value" />
                                                <ext:ConfigItem Name="Visible" Value="true" Mode="Value" />
                                            </CustomAttributes>
                                        </ext:TreeNode>
                                    </Nodes>
                                </ext:TreeNode>
                                <ext:TreeNode Icon="Folder" Expanded="true">
                                    <CustomAttributes>
                                        <ext:ConfigItem Name="Task" Value="Remodeling" Mode="Value" />
                                        <ext:ConfigItem Name="Duration" Value="12" Mode="Raw" />
                                        <ext:ConfigItem Name="User" Value="Tommy Maintz" Mode="Value" />
                                        <ext:ConfigItem Name="Visible" Value="true" Mode="Value" />
                                    </CustomAttributes>
                                    <Nodes>
                                        <ext:TreeNode Leaf="true">
                                            <CustomAttributes>
                                                <ext:ConfigItem Name="Task" Value="Retile kitchen" Mode="Value" />
                                                <ext:ConfigItem Name="Duration" Value="6.5" Mode="Raw" />
                                                <ext:ConfigItem Name="User" Value="Tommy Maintz" Mode="Value" />
                                                <ext:ConfigItem Name="Visible" Value="false" Mode="Value" />
                                            </CustomAttributes>
                                        </ext:TreeNode>
                                        <ext:TreeNode Leaf="true">
                                            <CustomAttributes>
                                                <ext:ConfigItem Name="Task" Value="Reattach screen door" Mode="Value" />
                                                <ext:ConfigItem Name="Duration" Value="2" Mode="Raw" />
                                                <ext:ConfigItem Name="User" Value="Tommy Maintz" Mode="Value" />
                                                <ext:ConfigItem Name="Visible" Value="false" Mode="Value" />
                                            </CustomAttributes>
                                        </ext:TreeNode>
                                    </Nodes>
                                </ext:TreeNode>
                            </Nodes>
                        </ext:TreeNode>
                    </Nodes>
                </ext:TreeNode>
            </Root>
        </ext:TreeGrid>
        </form>
    </body>
    </html>
    Thanx

    Matteo
  2. #2

    RE: [CLOSED] [1.0] TreeGridBooleanColumn

    Hi,

    Thanks for pointing out the bug. Fixed. Please update from SVN
  3. #3

    RE: [CLOSED] [1.0] TreeGridBooleanColumn

    Hi Vlad,

    fine. Thanx for the quick response.

    Matteo

Similar Threads

  1. Replies: 5
    Last Post: Jan 23, 2013, 2:58 PM

Posting Permissions