private void CreateFormHostElement(JQElement formHostParent) { var formHostContainer = new JQDivElement(); _formHost = new JQDivElement(); formHostContainer.Append(_formHost); switch (UITheme.Stylesheet) { case CSSFramework.Foundation6: formHostContainer.AddClass("row"); _formHost.AddClass("large-12"); _formHost.AddClass("columns"); break; case CSSFramework.PolyUi: formHostContainer.AddClass("grid"); _formHost.AddClass("centered grid__col--12"); break; case CSSFramework.Kubism: formHostContainer.AddClass("wrap"); break; case CSSFramework.Bootstrap: case CSSFramework.MaterialBootstrap: formHostContainer.AddClass("row"); _formHost.AddClass("col-lg-12 col-md-12"); break; } _formHost.AddClass("webform-host-container"); //In case user wants to style form container formHostParent.Append(formHostContainer); }
private void SetInternalElement(Element value) { _internalElement = value; InternalJQElement = new JQElement(_internalElement); InternalJQElement.Click += (sender, args) => Click?.Invoke(this, args); InternalJQElement.Focus += (sender, args) => Focus?.Invoke(this, args); InternalJQElement.LostFocus += (sender, args) => LostFocus?.Invoke(this, args); }
public static void StartApplication(NKApplication app, string targetElementSelector) { //Verify that we are running on JSIL if (Verbatim.Expression("0") == null) { throw new RequiresJSILRuntimeException(); } //TODO: Initialize DOM host object with jQuery var targetElement = new JQElement(JQuery.FromSelector(targetElementSelector).DomElement); app.HostElement = targetElement; app.Create(); }
/// <summary> /// Creates and adds another newForm to the page. /// </summary> /// <param name="newForm"></param> internal static void ShowNewForm(Form newForm) { var sharpJSApp = new WebApplication(Theme); var hostElement = Document.GetElementById(HostElementId); var newFormHost = new DivElement(); var jqMainFormHost = new JQElement(newFormHost); hostElement.AppendChild(newFormHost); var newWebForm = newForm.UnderlyingWebForm; newWebForm.InternalJQElement.Css("position", "relative"); //To allow child control positioning Forms.Add(newWebForm, newFormHost); sharpJSApp.Run(newWebForm, jqMainFormHost); InitializeWebUIElement(newForm, newWebForm); }
protected void CreateApplication(JQElement applicationHostElement) { CreateFormHostElement(applicationHostElement); }
public void Run(WebForm webForm, JQElement hostElement) { CreateApplication(hostElement); //Create containers webForm.InternalJQElement.AddClass("webform"); //Set class to allow user to style the form itself webForm.ContainerElement = _formHost.DomElement; //Set container to new element }