From 9ced66f2080bb29c112e5ecfcc28b88f0b17987b Mon Sep 17 00:00:00 2001 From: bjarnef Date: Mon, 19 Jan 2015 21:49:27 +0100 Subject: [PATCH 1/2] U4-4418 - fix issue with tab sorting Fixed issue with tab sorting, where you are able to drag the rows above the table header. Ensured that / is added, so the class "ui-sortable" is added to and only will be the drag-area. I also added styling for delete button so it's more consistent with other "delete"-buttons, e.g. for in settings for dropdown lists, checkbox lists and radionbutton lists. Furthermore the delete-button is moved inside the ItemTemplate, so the classes easily could be added to the button and also make the button stay close to the fields. --- .../umbraco/controls/ContentTypeControlNew.ascx | 6 +++--- .../controls/ContentTypeControlNew.ascx.cs | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx b/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx index f59534258d..5e14be9ed9 100644 --- a/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx +++ b/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx @@ -25,18 +25,18 @@ - + + -

diff --git a/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx.cs b/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx.cs index 096bb5b724..39f04b0688 100644 --- a/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx.cs +++ b/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx.cs @@ -28,6 +28,21 @@ namespace Umbraco.Web.UI.Umbraco.Controls DataTypeControllerUrl = Url.GetUmbracoApiServiceBaseUrl(x => x.GetById(0)); ContentTypeControllerUrl = Url.GetUmbracoApiServiceBaseUrl(x => x.GetAssignedListViewDataType(0)); } + + protected void dgTabs_PreRender(object sender, EventArgs e) + { + dgTabs.UseAccessibleHeader = true; //to make sure we render th, not td + + Table table = dgTabs.Controls[0] as Table; + if (table != null && table.Rows.Count > 0) + { + // here we render and + if (dgTabs.ShowHeader) + table.Rows[0].TableSection = TableRowSection.TableHeader; + if (dgTabs.ShowFooter) + table.Rows[table.Rows.Count - 1].TableSection = TableRowSection.TableFooter; + } + } } } \ No newline at end of file From 8393465e8afbc04de0f4b8511c35168ffb08f64f Mon Sep 17 00:00:00 2001 From: bjarnef Date: Tue, 20 Jan 2015 02:10:20 +0100 Subject: [PATCH 2/2] Ensure first tablerow is header after save too After the document type, media type or member type is saved, this will ensure first tablerow is a tableheader, so sorting is limited to --- .../umbraco/controls/ContentTypeControlNew.ascx | 2 +- .../umbraco/controls/ContentTypeControlNew.ascx.cs | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx b/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx index 5e14be9ed9..21230a343d 100644 --- a/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx +++ b/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx @@ -25,7 +25,7 @@ diff --git a/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx.cs b/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx.cs index 39f04b0688..fef17e6e2e 100644 --- a/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx.cs +++ b/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx.cs @@ -43,6 +43,17 @@ namespace Umbraco.Web.UI.Umbraco.Controls table.Rows[table.Rows.Count - 1].TableSection = TableRowSection.TableFooter; } } - + + protected void dgTabs_ItemDataBound(object sender, DataGridItemEventArgs e) + { + Table table = dgTabs.Controls[0] as Table; + if (table != null && table.Rows.Count > 0) + { + if (dgTabs.ShowHeader) + table.Rows[0].TableSection = TableRowSection.TableHeader; + if (dgTabs.ShowFooter) + table.Rows[table.Rows.Count - 1].TableSection = TableRowSection.TableFooter; + } + } } } \ No newline at end of file