Originally Posted by
Daniil
Hi @ATLAS,
I just ported WebForms examples to the MVC and committed to SVN trunk (see the DragDrop_Grid Area).
Hope this helps.
OK, I've hit the first issue. I've taken my working GridPanel and added the drag group, as per the examples. Code added below.
@(Html.X().GridPanel()
.ID("PERFORMANCE_CRITERIA_GRID_PANEL_ID")
.Region(Region.West)
.Layout(LayoutType.HBox)
.LayoutConfig(new HBoxLayoutConfig { Align = HBoxAlign.Stretch })
.Split(false)
.AutoScroll(true)
.Border(true)
.Flex(3)
.Width(1000)
.MaxHeight(750)
.Padding(2)
.Cls("custom-grid")
.ColumnLines(true)
.TopBar(
Html.X().Toolbar()
.Flat(true)
.Items(
Html.X().ToolbarFill(),
Html.X().Button()
.Icon(Icon.BulletPlus)
.Text(GlobalResources.ExpandAll)
.Handler("this.up('gridpanel').getView().getFeature('UserCompElementsGrouping').expandAll();"),
Html.X().Button()
.Icon(Icon.BulletMinus)
.Text(GlobalResources.CollapseAll)
.Handler("this.up('gridpanel').getView().getFeature('UserCompElementsGrouping').collapseAll();"),
Html.X().ToolbarSpacer().Width(30)
)
) /* -- end of top bar items -- */
.StoreID("SUBMIT_EVIDENCE_STORE_ID")
.ColumnModel(
Html.X().Column()
.ID("CU-ID")
.Hidden(true)
.DataIndex("CUId"),
Html.X().Column()
.ID("CE-ID")
.Hidden(true)
.DataIndex("CEId"),
Html.X().Column()
.ID("PerfCrit-ID")
.Hidden(true)
.DataIndex("PerfCritId"),
Html.X().SummaryColumn()
.Text(GlobalResources.CompetencyUnits)
.DataIndex("CUDescription")
.Hideable(false),
Html.X().Column()
.Text(GlobalResources.Unit)
.Width(100)
.Sortable(false)
.MenuDisabled(true)
.DataIndex("CUTitle"),
Html.X().SummaryColumn()
.Text(GlobalResources.Element)
.Width(100)
.Sortable(false)
.MenuDisabled(true)
.DataIndex("CEDescription"),
Html.X().SummaryColumn()
.Text(GlobalResources.PerformanceKnowledgeCriteriaAssessment)
.DataIndex("PerfCriteria")
.Sortable(false)
.MenuDisabled(true)
.Flex(1),
Html.X().CheckColumn()
.Text(GlobalResources.Select)
.DataIndex("IsSelected")
.Editable(true)
.MenuDisabled(true)
.Renderer(new Renderer() { Fn = "fnRenderElementSelectedCheckbox" })
.Sortable(false)
.Width(60)
.ToolTip(GlobalResources.TooltipSelectToAssociateItemWithEvidence)
.Align(Alignment.Center)
.Listeners(l =>
{
l.CheckChange.Fn = "fnCheckboxChange";
l.AfterRender.Fn = "fnPostRenderElementSelectedCheckbox";
})
)
.SelectionModel(Html.X().RowSelectionModel().Mode(SelectionMode.Single))
.View(Html.X().GridView()
.Plugins(Html.X().GridDragDrop().EnableDrop(false).DDGroup("gridDDGroup"))
)
.Features(
Html.X().Grouping()
.ID("UserCompElementsGrouping")
.GroupHeaderTplString("{name} ({rows.length} Element{[values.rows.length > 1 ? 's' : '']})")
.HideGroupedHeader(true)
.EnableGroupingMenu(false)
.StartCollapsed(true)
)
.BottomBar(bar => bar.Add(Html.X().PagingToolbar()
.Flat(true)
.DisplayInfo(true)
.DisplayMsg(GlobalResources.ToolbarDisplayElements)))
.View(Html.X().GridView()
.StripeRows(true)
.TrackOver(true))
)
As soon as I add ......
.SelectionModel(Html.X().RowSelectionModel().Mode(SelectionMode.Single))
.View(Html.X().GridView()
.Plugins(Html.X().GridDragDrop().EnableDrop(false).DDGroup("gridDDGroup"))
)
..... I get an exception on page load.
Only one item can be added to this Items Collection.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Ext.Net.ExcessItemsException: Only one item can be added to this Items Collection.
Source Error:
Line 103: if (Count > 0)
Line 104: {
Line 105: throw new ExcessItemsException(ExcessItemsMessage);
Line 106: }
Line 107: }
Source File: c:\Users\mckelvied\Projects\VS2012 Projects\Ext.Net SVN v2.2.1\Ext.Net\Utility\SingleItemCollection.cs Line: 105
Any thoughts?