Skip to content

Commit

Permalink
Added logic to hide the search panel when there are no items in a field
Browse files Browse the repository at this point in the history
  • Loading branch information
mac committed Jul 11, 2016
1 parent 2554f0d commit caa8e3c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div>
<asp:LinkButton Text="Add New Item" runat="server" ID="AddItem" OnClick="AddItem_Click"/>
</div>
<asp:Panel runat="server" DefaultButton="SearchItems">
<asp:Panel runat="server" DefaultButton="SearchItems" id="SearchPanel" Visible="false">
<asp:TextBox runat="server" ID="SearchText" style="display:inline; width: 200px;" placeholder="Search ..." />
<asp:LinkButton ID="SearchItems" Text="Search" runat="server" OnClick="SearchItems_Click"/>
</asp:Panel>
Expand Down
20 changes: 20 additions & 0 deletions WebApplication/Admin/Controls/Fields/MultiFileUploader.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,16 @@ private void BindValues()

FieldItems.DataSource = GetValue();
FieldItems.DataBind();

if(((dynamic)FieldItems.DataSource).Count > 0)
{
SearchPanel.Visible = true;
}
else
{
SearchPanel.Visible = false;
}

break;
}
default:
Expand All @@ -156,6 +166,16 @@ private void BindValues()

Values.DataSource = GetValue();
Values.DataBind();

if (((dynamic)Values.DataSource).Count > 0)
{
SearchPanel.Visible = true;
}
else
{
SearchPanel.Visible = false;
}

break;
}
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified WebApplication/bin/WebApplication.dll
Binary file not shown.
Binary file modified WebApplication/bin/WebApplication.pdb
Binary file not shown.

0 comments on commit caa8e3c

Please sign in to comment.