public static void DefineNiceController() { AngularJSDemo.hwbApp.Controller<ControllerDataObjectStructure> ("hwcSctl", CtlFunction); var ctlDiv = new DivElement(); ctlDiv.SetNGController("hwcSctl"); Document.Body.AppendChild(ctlDiv); var fltFld = new InputElement(); fltFld.SetNGModel("hwcFlt"); ctlDiv.AppendChild(fltFld); var ordFld = new SelectElement(); ordFld.SetNGModel("hwcOrderBy"); ordFld.Add(new OptionElement() { Value = "Checkpoint", InnerHTML = "Alphabetically" }); ordFld.Add(new OptionElement() { Value = "id", InnerHTML = "Series ID" }); ctlDiv.AppendChild(ordFld); var rptSpan = new SpanElement(); rptSpan.SetNGRepeat("checkpoint", "checkpoints", fltFld.GetNGModel(), ordFld.GetNGModel()); rptSpan.InnerHTML = "{{checkpoint.callsign}}[{{checkpoint.id}}] "; ctlDiv.AppendChild(rptSpan); }
public static Element GetRepeatRegion() { var itemsSpan = new SpanElement(); itemsSpan.InnerHTML = "Checkpoint"; var itemsPara = new ParagraphElement(); itemsPara.InnerHTML = "{{checkpoint.callsign}}[{{checkpoint.id}}]"; var itemsLI = new LIElement(); itemsLI.SetNGRepeat("checkpoint", "checkpoints"); itemsLI.AppendChild(itemsSpan); itemsLI.AppendChild(itemsPara); var itemsUL = new UListElement(); itemsUL.AppendChild(itemsLI); var itemsSubSpan = new SpanElement() { InnerHTML = "[{{checkpoint.callsign}}.{{checkpoint.id}}] " }; var itemsSearchBox = new InputElement(); itemsSearchBox.SetNGModel("cpFilter"); var itemsOrderSelector = GetOrderBySelector("cpOrderBy"); itemsSubSpan.SetNGRepeat("checkpoint", "checkpoints", itemsSearchBox.GetNGModel(), itemsOrderSelector.GetNGModel()); var itemsDiv = new DivElement(); itemsDiv.SetNGController("hwbSctl"); itemsDiv.AppendChild(itemsUL); itemsDiv.AppendChild(itemsSearchBox); itemsDiv.AppendChild(itemsOrderSelector); itemsDiv.AppendChild(itemsSubSpan); return itemsDiv; }