RowExpander and RowEditing in same grid

  1. #1

    RowExpander and RowEditing in same grid

    I saw this post in the premium forums, but I guess she never followed up with the 2nd part of the question:

    http://forums.ext.net/showthread.php...Editing-plugin

    I have a similar issue where I need to edit the parent row/cell but also need an expander to collapse/expand child data.
    Even if I set the ClicksToEdit property to 1 or 2 and the ExpandOnDblClick property to false, the editor never shows and the row still expands on a double click.

    Thanks for any help in advance... loving the badges feature in 2.5!

    Here is the snippet I am referring to in my code:

                            Html.X().GridPanel()
                                .ID("grdPlanningUOWsWS")
                                .Width(885)
                                .Height(400)
                                .EnableColumnHide(false)
                                .SelectionModel(Html.X().CellSelectionModel())
                                .Plugins(
                                    Html.X().CellEditing().ClicksToEdit(1).Listeners(ls => ls.Edit.Fn = "editPlanningWS"),
                                    Html.X().RowExpander()
                                    .ExpandOnDblClick(false)
                                    .Listeners(li =>
                                    {
                                        li.Expand.Handler = "setAssignedFilter(record)";
                                        li.Collapse.Handler = "removeAssignedFilter()";
                                    })
                                    .Component(
                                        Html.X().GridPanel().Width(400)
                                        .SortableColumns(false).EnableColumnHide(false).EnableColumnMove(false)
                                        .View(Html.X().GridView().OverItemCls(" "))
                                        .Store(
                                            Html.X().Store().ID("storePlanningWorkitems")
                                            .DataSource(Model.UOWModelsWS.SelectMany(wi => wi.UOWWorkitems.ToList()))
                                            .AutoLoad(true)
                                            .Model(Html.X().Model()
                                                    .Fields(
                                                        Html.X().ModelField().Name("UnitOfWorkKey").Type(ModelFieldType.Int),
                                                        Html.X().ModelField().Name("WorkitemKey").Type(ModelFieldType.Int),
                                                        Html.X().ModelField().Name("WorkitemTitle").Type(ModelFieldType.String),
                                                        Html.X().ModelField().Name("WorkitemStatusName").Type(ModelFieldType.String),
                                                        Html.X().ModelField().Name("BaseStartDate").Type(ModelFieldType.Date),
                                                        Html.X().ModelField().Name("BaseEndDate").Type(ModelFieldType.Date),
                                                        Html.X().ModelField().Name("BaseDuration").Type(ModelFieldType.Int),
                                                        Html.X().ModelField().Name("ActualStartDate").Type(ModelFieldType.Date),
                                                        Html.X().ModelField().Name("ActualEndDate").Type(ModelFieldType.Date),
                                                        Html.X().ModelField().Name("ActualDuration").Type(ModelFieldType.Int),
                                                        Html.X().ModelField().Name("PercentComplete").Type(ModelFieldType.Float)
                                                    )
                                            )
                                        )
                                        .ColumnModel(
                                            Html.X().Column().DataIndex("UnitOfWorkKey").Hidden(true),
                                            Html.X().Column().DataIndex("WorkitemKey").Hidden(true),
                                            Html.X().Column().DataIndex("WorkitemTitle").Flex(4).Text("Title"),
                                            Html.X().Column().DataIndex("WorkitemStatusName").Flex(2).Text("Status"),
                                            Html.X().DateColumn().DataIndex("BaseStartDate").Flex(2).Text("Base Start"),
                                            Html.X().DateColumn().DataIndex("BaseEndDate").Flex(2).Text("Base End"),
                                            Html.X().Column().DataIndex("BaseDuration").Flex(1).Text("Base Duration"),
                                            Html.X().DateColumn().DataIndex("ActualStartDate").Flex(2).Text("Actual Start"),
                                            Html.X().DateColumn().DataIndex("ActualEndDate").Flex(2).Text("Actual End"),
                                            Html.X().Column().DataIndex("ActualDuration").Flex(1).Text("Actual Duration"),
                                            Html.X().NumberColumn().DataIndex("PercentComplete").Flex(2).Text("% Complete")
                                        )
                                    )
                                )
                                .Store(
                                    Html.X().Store()
                                        .ID("storePlanningUOWsWS")
                                        .DataSource(Model.UOWModelsWS)
                                        .AutoLoad(true)
                                        .Model(Html.X().Model()
                                                .Fields(
                                                    Html.X().ModelField().Name("ProjectKey").Type(ModelFieldType.Int),
                                                    Html.X().ModelField().Name("ProjectName").Type(ModelFieldType.String),
                                                    Html.X().ModelField().Name("UnitOfWorkKey").Type(ModelFieldType.Int),
                                                    Html.X().ModelField().Name("UnitOfWorkName").Type(ModelFieldType.String),
                                                    Html.X().ModelField().Name("IntraRank").Type(ModelFieldType.Int),
                                                    Html.X().ModelField().Name("InterRank").Type(ModelFieldType.Int),
                                                    Html.X().ModelField().Name("PercentComplete").Type(ModelFieldType.Int)
                                                )
                                        )
                                )
                                .ColumnModel(
                                    Html.X().Column()
                                        .DataIndex("ProjectKey")
                                        .ID("colProjectKeyA")
                                        .Hidden(true),
                                    Html.X().Column()
                                        .DataIndex("ProjectName")
                                        .ID("colProjectNameA")
                                        .Text("Project Name")
                                        .Flex(2),
                                    Html.X().Column()
                                        .DataIndex("UnitOfWorkKey")
                                        .ID("colUnitOfWorkKeyA")
                                        .Hidden(true),
                                    Html.X().Column()
                                        .DataIndex("UnitOfWorkName")
                                        .ID("colUnitOfWorkNameA")
                                        .Text("Unit Of Work Name")
                                        .Flex(4),
                                    Html.X().Column()
                                        .DataIndex("IntraRank")
                                        .ID("colUnitOfWorkIntraRankA")
                                        .Text("Intra-Rank")
                                        .Flex(1)
                                        .Editor(Html.X().NumberField()),
                                    Html.X().Column()
                                        .DataIndex("InterRank")
                                        .ID("colUnitOfWorkInterRankA")
                                        .Text("Inter-Rank")
                                        .Flex(1)
                                        .Editor(Html.X().NumberField()),
                                    Html.X().ProgressBarColumn()
                                        .DataIndex("PercentComplete")
                                        .Text("% Complete")
                                        .ID("colUnitOfWorkPctComplete")
                                        .Flex(2)                                    
                                )
  2. #2
    Hi @jshu,

    Please clarify is the issue reproducible with my example here?
    http://forums.ext.net/showthread.php...l=1#post129221
  3. #3
    thank you it worked :)

    just hadn't tried it exactly as it was written.

    you can close this one but I think I need to open another one...

Similar Threads

  1. Replies: 1
    Last Post: Mar 11, 2014, 5:34 AM
  2. Replies: 1
    Last Post: Feb 04, 2014, 3:30 PM
  3. [CLOSED] Rowediting grid with Gridcommand icons
    By ASAPCH in forum 2.x Legacy Premium Help
    Replies: 12
    Last Post: Nov 15, 2012, 3:38 PM
  4. [CLOSED] Two column combo in grid rowediting plugin
    By ASAPCH in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 08, 2012, 4:52 PM
  5. [CLOSED] Grid RowEditing Plugin - Height
    By adelaney in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 13, 2012, 9:00 PM

Tags for this Thread

Posting Permissions