Ejemplo n.º 1
0
        protected override void OnFirstPreRender()
        {
            base.OnFirstPreRender();

            if (Layout != Layout.Container)
            {
                OB.AddProperty("layout", LayoutHelper.GetName(Layout));

                if (Layout == Layout.Table)
                {
                    OptionBuilder layoutConfigOB = new OptionBuilder();
                    layoutConfigOB.AddProperty("columns", TableConfigColumns);

                    OB.AddProperty("layoutConfig", layoutConfigOB);
                }
                else if (Layout == Layout.HBox || Layout == Layout.VBox)
                {
                    OptionBuilder layoutConfigOB = new OptionBuilder();
                    if (BoxConfigAlign != BoxLayoutAlign.Top)
                    {
                        layoutConfigOB.AddProperty("align", BoxLayoutAlignHelper.GetName(BoxConfigAlign, Layout));
                    }

                    if (BoxConfigPosition != BoxLayoutPosition.Left)
                    {
                        layoutConfigOB.AddProperty("pack", BoxLayoutPositionHelper.GetName(BoxConfigPosition));
                    }

                    if (BoxConfigPadding != "0")
                    {
                        layoutConfigOB.AddProperty("padding", BoxConfigPadding);
                    }

                    if (BoxConfigChildMargin != "0")
                    {
                        layoutConfigOB.AddProperty("defaultMargins", BoxConfigChildMargin);
                    }


                    OB.AddProperty("layoutConfig", layoutConfigOB);
                }
            }
        }
Ejemplo n.º 2
0
        protected override void OnFirstPreRender()
        {
            base.OnFirstPreRender();


            AddStartupAbsoluteScript("X.form_upload_file=true;");


            if (!String.IsNullOrEmpty(ButtonText))
            {
                OB.AddProperty("buttonText", ButtonText);
            }

            if (ButtonOnly)
            {
                OB.AddProperty("buttonOnly", true);
            }


            string resolvedIconUrl = IconHelper.GetResolvedIconUrl(ButtonIcon, ButtonIconUrl);

            if (!String.IsNullOrEmpty(resolvedIconUrl))
            {
                OptionBuilder buttonOB = new OptionBuilder();
                buttonOB.AddProperty("cls", " x-btn-text-icon");
                buttonOB.AddProperty("icon", resolvedIconUrl);

                OB.AddProperty("buttonCfg", buttonOB);
            }
            //if (TextMode != TextMode.Text)
            //{
            //    OB.AddProperty("inputType", TextModeHelper.GetName(TextMode));
            //}

            string jsContent = String.Format("var {0}=new Ext.ux.form.FileUploadField({1});", XID, OB.ToString());

            AddStartupScript(jsContent);
        }
Ejemplo n.º 3
0
        protected override void OnFirstPreRender()
        {
            base.OnFirstPreRender();

            if (Layout != Layout.Container)
            {
                OB.AddProperty("layout", LayoutHelper.GetName(Layout));

                if (Layout == Layout.Table)
                {
                    OptionBuilder layoutConfigOB = new OptionBuilder();
                    layoutConfigOB.AddProperty("columns", TableConfigColumns);

                    OB.AddProperty("layoutConfig", layoutConfigOB);
                }
                else if (Layout == Layout.HBox || Layout == Layout.VBox)
                {
                    OptionBuilder layoutConfigOB = new OptionBuilder();
                    if (BoxConfigAlign != BoxLayoutAlign.Top)
                    {
                        layoutConfigOB.AddProperty("align", BoxLayoutAlignHelper.GetName(BoxConfigAlign, Layout));
                    }

                    if (BoxConfigPosition != BoxLayoutPosition.Left)
                    {
                        layoutConfigOB.AddProperty("pack", BoxLayoutPositionHelper.GetName(BoxConfigPosition));
                    }

                    if (BoxConfigPadding != "0")
                    {
                        layoutConfigOB.AddProperty("padding", BoxConfigPadding);
                    }

                    if (BoxConfigChildMargin != "0")
                    {
                        layoutConfigOB.AddProperty("defaultMargins", BoxConfigChildMargin);
                    }

                    
                    OB.AddProperty("layoutConfig", layoutConfigOB);
                }

            }

            
        }
Ejemplo n.º 4
0
        protected override void OnFirstPreRender()
        {
            base.OnFirstPreRender();


            AddStartupAbsoluteScript("X.form_upload_file=true;");


            if (!String.IsNullOrEmpty(ButtonText))
            {
                OB.AddProperty("buttonText", ButtonText);
            }

            if (ButtonOnly)
            {
                OB.AddProperty("buttonOnly", true);
            }


            string resolvedIconUrl = IconHelper.GetResolvedIconUrl(ButtonIcon, ButtonIconUrl);
            if (!String.IsNullOrEmpty(resolvedIconUrl))
            {
                OptionBuilder buttonOB = new OptionBuilder();
                buttonOB.AddProperty("cls", " x-btn-text-icon");
                buttonOB.AddProperty("icon", resolvedIconUrl);

                OB.AddProperty("buttonCfg", buttonOB);
            }
            //if (TextMode != TextMode.Text)
            //{
            //    OB.AddProperty("inputType", TextModeHelper.GetName(TextMode));
            //}

            string jsContent = String.Format("var {0}=new Ext.ux.form.FileUploadField({1});", XID, OB.ToString());
            AddStartupScript(jsContent);
        }