Aug 18, 2014, 11:43 AM
Search form
I want to make a search form like the one in attachment (it is from desktop app). So far I have done this:
X.FormPanel().ID("SearchForm").Title("Search Form").Height(300).Layout(LayoutType.Form).AutoScroll(true).Items
(
fields =>
{
for(int i=0;i<20;i++)
{
fields.Add(X.Panel().Border(false).Width(800).Layout(LayoutType.HBox).Items
(
X.Label().Text(String.Format("Search field {0}:", i)).Padding(6),
X.SplitButton().Text("=").Width(40).Menu(X.Menu()
.Items(operators =>
{
operators.Add(X.MenuItem().Text("="));
operators.Add(X.MenuItem().Text(">"));
operators.Add(X.MenuItem().Text("<"));
}
)
//.Listeners(l =>
//{
// l.Click.Fn = "this.up('splitbutton').setText(menuItem.text)";
//})
),
X.TextField().Width(300).Padding(6)
));
}
}
)
I don't like that label, button and textfield are not aligned horizontally by middle. Also, I would like to have all text fields left aligned vertically. The reason why am I adding controls dynamically is because it is needed by my application design (search forms are configurable). Please help.