protected virtual void WriteFilter(HtmlTextWriter writer, FilterRow row) { //'<tr><td valign="top">'.$this->DrawFilterName($filter).'</td><td>'.$this->DrawFilterBox($filter).'</td></tr>' writer.RenderBeginTag(HtmlTextWriterTag.Tr); writer.AddAttribute(HtmlTextWriterAttribute.Valign, "top"); writer.RenderBeginTag(HtmlTextWriterTag.Td); WriteFilterName(writer, row); writer.RenderEndTag(); writer.RenderBeginTag(HtmlTextWriterTag.Td); WriteFilterBox(writer, row); writer.RenderEndTag(); writer.RenderEndTag(); }
protected virtual void WriteFilterName(HtmlTextWriter writer, FilterRow row) { writer.Write(row.name); }
protected virtual void WriteFilterBoxList(HtmlTextWriter writer, FilterRow row) { //writer.AddAttribute(HtmlTextWriterAttribute.Class, "g_filter_box g_filter"); //writer.RenderBeginTag(HtmlTextWriterTag.Select); //writer.AddAttribute(HtmlTextWriterAttribute.Value, string.Empty); //writer.RenderBeginTag(HtmlTextWriterTag.Option); //writer.Write("-- Не указано --"); //writer.RenderEndTag(); int count = 0; foreach (ValuesRow valuesRow in row.values) { foreach (ValueRow valueRow in valuesRow.row) { if(!string.IsNullOrEmpty(valueRow.Text)) { WriteFilterBoxInputList(writer, row, count); return; } count++; writer.AddAttribute(HtmlTextWriterAttribute.Value, valueRow.ssdmodification.Replace("\"", "\"\"")); writer.RenderBeginTag(HtmlTextWriterTag.Option); writer.Write(valueRow.name); writer.RenderEndTag(); } } if(count == 0) WriteEmpty(writer); writer.RenderEndTag(); }
protected virtual void WriteFilterBoxInputList(HtmlTextWriter writer, FilterRow row, int id) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "g_filter"); writer.RenderBeginTag(HtmlTextWriterTag.Div); foreach (ValuesRow valuesRow in row.values) { if(valuesRow.row.Length > 5) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "g_filter_scroller"); writer.RenderBeginTag(HtmlTextWriterTag.Div); } foreach (ValueRow valueRow in valuesRow.row) { //<div class="g_filter_label"><label> writer.AddAttribute(HtmlTextWriterAttribute.Class, "g_filter_label"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.RenderBeginTag(HtmlTextWriterTag.Label); //<input type="radio" name="filter_'.$id.'" class="g_filter g_filter_radio" ssd="'.str_replace('"', '""', $value['ssdmodification']).'"> writer.AddAttribute(HtmlTextWriterAttribute.Type, "radio"); writer.AddAttribute(HtmlTextWriterAttribute.Name, string.Concat("filter_", id)); writer.AddAttribute(HtmlTextWriterAttribute.Class, "g_filter g_filter_radio"); writer.AddAttribute("ssd", valueRow.ssdmodification.Replace("\"", "\"\"")); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); //<span class="g_filter_name">'.$value['name'].'</span><br> writer.AddAttribute(HtmlTextWriterAttribute.Class, "g_filter_name"); writer.RenderBeginTag(HtmlTextWriterTag.Span); writer.Write(valueRow.name); writer.RenderEndTag(); writer.WriteBreak(); //<div class="g_filter_note">'.str_replace("\n", '<br>', (string)$value).'</div> writer.AddAttribute(HtmlTextWriterAttribute.Class, "g_filter_note"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.Write(valueRow.Text.Replace("\n", "<br>")); writer.RenderEndTag(); //</label></div> writer.RenderEndTag(); writer.RenderEndTag(); } if (valuesRow.row.Length > 5) { writer.RenderEndTag(); } } writer.RenderEndTag(); }
protected virtual void WriteFilterBoxInput(HtmlTextWriter writer, FilterRow row) { //<input type=text class="g_filter g_filter_box" regexp="'.str_replace('"', '""', $filter['regexp']).'" ssd="'.str_replace('"', '""', $filter['ssdmodification']).'"> writer.AddAttribute(HtmlTextWriterAttribute.Type, "text"); writer.AddAttribute(HtmlTextWriterAttribute.Class, "g_filter g_filter_box"); writer.AddAttribute("regexp", row.regexp.Replace("\"", "\"\"")); writer.AddAttribute("ssd", row.ssdmodification.Replace("\"", "\"\"")); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); }
protected virtual void WriteFilterBox(HtmlTextWriter writer, FilterRow row) { if(row.type.Equals("list")) { WriteFilterBoxList(writer, row); } else { WriteFilterBoxInput(writer, row); } }