Gridpanel filter does not show

  1. #1

    Gridpanel filter does not show

    Hello
    I have simple problem (or at least it appears to be simple). My Gridpanel FilterHeader is not shown when columns are created dynamically. Please see following sample:
    @{
        ViewBag.Title = "Filter";
        Layout = "~/Views/Shared/_BaseLayout.cshtml";
        var X = Html.X();
    }
    
    @section example
    {
        @(
            X.Viewport().ID("viewPort").Layout(LayoutType.Fit).Items
            (
                Html.X().GridPanel().Title("Filter example")
                .Store
                (
                    Html.X().Store()
                    .Model
                    (
                        Html.X().Model()
                        .Fields
                        (
                            new ModelField("company"),
                            new ModelField("price", ModelFieldType.Float),
                            new ModelField("change", ModelFieldType.Float),
                            new ModelField("pctChange", ModelFieldType.Float),
                            new ModelField("lastChange", ModelFieldType.Date)
                        )
                    )
                )
                .Plugins(Html.X().FilterHeader())
                .ColumnModel
                (
                    c =>
                    {
                        RowNumbererColumn c1 = new RowNumbererColumn();
                        c.Add(c1);
                        Column c2 = new Column();
                        c2.Text = "Company";
                        c2.DataIndex = "company";
                        c2.Flex = 1;
                        c.Add(c2);
                        Column c3 = new Column();
                        c3.Text = "Price";
                        c3.DataIndex = "price";
                        c3.Width = 75;
                        c3.Renderer.Format = RendererFormat.UsMoney;
                        c.Add(c3);
                        Column c4 = new Column();
                        c4.Text = "Change";
                        c4.DataIndex = "change";
                        c4.Width = 75;
                        c.Add(c4);
                        Column c5 = new Column();
                        c5.Text = "Change";
                        c5.DataIndex = "pctChange";
                        c5.Width = 75;
                        c.Add(c5);
                        DateColumn c6 = new DateColumn();
                        c6.Text = "Last Updated";
                        c6.DataIndex = "lastChange";
                        c6.Width = 85;
                        c6.Format = "H:mm:ss";
                        c.Add(c6);
                    }
                    //Html.X().RowNumbererColumn(),
                    //Html.X().Column().Text("Company").DataIndex("company").Flex(1),
                    //Html.X().Column().Text("Price").DataIndex("price").Width(75).Renderer(RendererFormat.UsMoney),
                    //Html.X().Column().Text("Change").DataIndex("change").Width(75),
                    //Html.X().Column().Text("Change").DataIndex("pctChange").Width(75),
                    //Html.X().DateColumn().Text("Last Updated").DataIndex("lastChange").Width(85).Format("H:mm:ss")
                )
            )
        )
    }
    If you comment dynamic column creation (with delegate function) and uncomment fixed columns, filter suddenly appears. Since I need to create columns dynamically, what I have to do that filter will be shown?

    Thanks
  2. #2
    Daniil,
    I don't know how to narrow problem more down. I have really searched not only ext.net forum, but also ext.js, I googled, but I reveal nothing. This is simple, just copy/paste code and see the problem. I even think this might be bug. So, can you please help me to find workaround?

Similar Threads

  1. Replies: 4
    Last Post: Sep 17, 2014, 9:25 AM
  2. Replies: 7
    Last Post: Mar 12, 2013, 9:15 AM
  3. Replies: 11
    Last Post: Jun 13, 2012, 9:45 PM
  4. Replies: 2
    Last Post: May 01, 2012, 5:57 PM
  5. Replies: 1
    Last Post: Jun 01, 2011, 4:22 PM

Tags for this Thread

Posting Permissions