Changed selection of default order by column for container document types to drop down list

This commit is contained in:
AndyButland
2014-07-27 15:09:35 +02:00
parent 5ad8ebfa6e
commit eec6fe2115
2 changed files with 12 additions and 8 deletions

View File

@@ -86,7 +86,12 @@
</cc2:PropertyPanel>
<cc2:PropertyPanel ID="pp_containerConfigOrderBy" runat="server" Text="List view order by<br/><small>The column for the default order for the list (default if not provided: UpdateDate)</small>">
<asp:TextBox ID="txtContainerConfigOrderBy" CssClass="guiInputText guiInputStandardSize" runat="server"></asp:TextBox>
<asp:DropDownList ID="ddlContainerConfigOrderBy" CssClass="guiInputText guiInputStandardSize" runat="server">
<asp:ListItem Value=""></asp:ListItem>
<asp:ListItem Value="Name">Node Name</asp:ListItem>
<asp:ListItem Value="UpdateDate">Last Edited Date</asp:ListItem>
<asp:ListItem Value="Owner">Updated By</asp:ListItem>
</asp:DropDownList>
</cc2:PropertyPanel>
<cc2:PropertyPanel ID="pp_containerConfigOrderDirection" runat="server" Text="List view order direction<br/><small>The direction of the default order for the list (default if not provided: Descending)</small>">

View File

@@ -382,9 +382,9 @@ namespace umbraco.controls
configProvided = true;
}
if (!string.IsNullOrEmpty(txtContainerConfigOrderBy.Text))
if (ddlContainerConfigOrderBy.SelectedIndex > 0)
{
orderBy = txtContainerConfigOrderBy.Text;
orderBy = ddlContainerConfigOrderBy.SelectedItem.Value;
configProvided = true;
}
@@ -618,19 +618,18 @@ jQuery(document).ready(function() {{ refreshDropDowns(); }});
allowAtRoot.Checked = _contentType.AllowAtRoot;
cb_isContainer.Checked = _contentType.IsContainerContentType;
ddlContainerConfigOrderBy.SelectedIndex = -1;
ddlContainerConfigOrderDirection.SelectedIndex = -1;
if (!string.IsNullOrEmpty(_contentType.ContainerConfig))
{
var containerConfig = GetContentTypeContainerConfigurationFromJsonString(_contentType.ContainerConfig);
txtContainerConfigPageSize.Text = containerConfig.PageSize.ToString();
txtContainerConfigOrderBy.Text = containerConfig.OrderBy;
ddlContainerConfigOrderDirection.SelectedIndex = -1;
ddlContainerConfigOrderBy.Items.FindByValue(containerConfig.OrderBy).Selected = true;
ddlContainerConfigOrderDirection.Items.FindByValue(containerConfig.OrderDirection).Selected = true;
}
else
{
txtContainerConfigPageSize.Text = string.Empty;
txtContainerConfigOrderBy.Text = string.Empty;
ddlContainerConfigOrderDirection.SelectedIndex = -1;
}
}
@@ -1410,7 +1409,7 @@ jQuery(document).ready(function() {{ refreshDropDowns(); }});
protected global::System.Web.UI.WebControls.TextBox txtContainerConfigPageSize;
protected global::umbraco.uicontrols.PropertyPanel pp_containerConfigOrderBy;
protected global::System.Web.UI.WebControls.TextBox txtContainerConfigOrderBy;
protected global::System.Web.UI.WebControls.DropDownList ddlContainerConfigOrderBy;
protected global::umbraco.uicontrols.PropertyPanel pp_containerConfigOrderDirection;
protected global::System.Web.UI.WebControls.DropDownList ddlContainerConfigOrderDirection;