public void RenderPageDropDown(TextWriter writer) { HtmlComposite coldiv = new HtmlComposite("div", new HtmlAttribute("class", "col-xs-3")); HtmlComposite rowb1 = coldiv.AppendComposite("div", new HtmlAttribute("class", "row-fluid")); HtmlComposite cellb1 = rowb1.AppendComposite("div", new HtmlAttribute("class", "col-xs-6")); cellb1.AppendSimple("label", "Page Size", new HtmlAttribute("class", "control-label pull-right")); HtmlComposite cellb2 = rowb1.AppendComposite("div", new HtmlAttribute("class", "col-xs-6")); HtmlComposite dropdown = cellb2.AppendComposite( "select", new HtmlAttribute("name", _PageSize.Key), new HtmlAttribute("id", _PageSize.Key), new HtmlAttribute("class", "form-control changeReload")); for (int i = 10; i <= 50; i += 10) { dropdown.AppendHtmlOption(i, i.ToString(), i == _PageSize.Value); } coldiv.Write(writer); }
private HtmlComposite BuildTableHeader <T>() { HtmlComposite thead = new HtmlComposite("thead"); HtmlComposite thead_tr = thead.AppendComposite("tr"); foreach (BootstrapQueryHelperColumn col in this.columns) { HtmlComposite th = thead_tr.AppendComposite("th"); HtmlComposite tha = th.AppendComposite("a"); tha.AppendText(col.Caption + " "); tha.AppendAttribute("href", "javascript:void(0)"); if (col.Name.Equals(this.OrderBy, StringComparison.OrdinalIgnoreCase)) { if (this.OrderByDirection == EixoX.Data.SortDirection.Ascending) { tha.AppendSimple( "span", "", new HtmlAttribute("class", "fa fa-sort-asc")); tha.AppendAttribute("onclick", string.Concat("EixoX.sortGrid(this,'", col.Name, "','", EixoX.Data.SortDirection.Descending, "')")); } else { tha.AppendSimple( "span", "", new HtmlAttribute("class", "fa fa-sort-desc")); tha.AppendAttribute("onclick", string.Concat("EixoX.sortGrid(this,'", col.Name, "','", EixoX.Data.SortDirection.Ascending, "')")); } } else { tha.AppendSimple( "span", "", new HtmlAttribute("class", "fa fa-sort")); tha.AppendAttribute("onclick", string.Concat("EixoX.sortGrid(this,'", col.Name, "','", EixoX.Data.SortDirection.Ascending, "')")); } } HtmlComposite tr2 = thead.AppendComposite("tr"); foreach (BootstrapQueryHelperColumn col in this.columns) { HtmlComposite th2 = tr2.AppendComposite( "td", new HtmlAttribute("style", "padding:0px") ); th2.AppendStandalone( "input", new HtmlAttribute("type", "text"), new HtmlAttribute("placeholder", "filtrar"), new HtmlAttribute("name", col.Name), new HtmlAttribute("value", col.Filter), new HtmlAttribute("style", "margin:0px; border-radius:0px; display:block; width:94%; border:none;")); } return(thead); }
public void RenderOrderBy(TextWriter writer) { HtmlComposite coldiv = new HtmlComposite("div", new HtmlAttribute("style", "display:none")); coldiv.AppendSimple( "label", "Order by", new HtmlAttribute("class", "control-label")); coldiv.Write(writer); coldiv = new HtmlComposite("div", new HtmlAttribute("style", "display:none")); HtmlComposite selectOrderBy = coldiv.AppendComposite( "select", new HtmlAttribute("name", _OrderBy.Key), new HtmlAttribute("id", _OrderBy.Key), new HtmlAttribute("class", "changeReload")); EixoX.Data.DatabaseAspect <T> aspect = EixoX.Data.DatabaseAspect <T> .Instance; for (int i = 0; i < aspect.Count; i++) { selectOrderBy.AppendHtmlOption(i, aspect[i].Name, i == _OrderBy.Value); } coldiv.Write(writer); coldiv = new HtmlComposite("div", new HtmlAttribute("style", "display:none")); HtmlComposite selectDirection = coldiv.AppendComposite( "select", new HtmlAttribute("name", _SortDirection.Key), new HtmlAttribute("id", _SortDirection.Key), new HtmlAttribute("class", "input-small changeReload")); if (_SortDirection.Value == EixoX.Data.SortDirection.Ascending) { selectDirection.AppendSimple( "option", EixoX.Data.SortDirection.Ascending, new HtmlAttribute("value", EixoX.Data.SortDirection.Ascending), new HtmlAttribute("selected", "selected")); selectDirection.AppendSimple( "option", EixoX.Data.SortDirection.Descending, new HtmlAttribute("value", EixoX.Data.SortDirection.Descending)); } else { selectDirection.AppendSimple( "option", EixoX.Data.SortDirection.Ascending, new HtmlAttribute("value", EixoX.Data.SortDirection.Ascending)); selectDirection.AppendSimple( "option", EixoX.Data.SortDirection.Descending, new HtmlAttribute("value", EixoX.Data.SortDirection.Descending), new HtmlAttribute("selected", "selected")); } coldiv.Write(writer); }