Mar 20, 2014, 8:29 PM
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:
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)
)