コード例 #1
0
        /// <summary>
        /// Write the properties from the bag to the writer. This method can be overrided for advanced scenarios.
        /// </summary>
        /// <param name="jw">The writer.</param>
        protected override void WriteProperties(DextopJsWriter jw)
        {
            jw.AddProperty("name", name);
            jw.AddLocalizationProperty("fieldLabel", fieldLabel, ItemName + "FieldLabelText");
            jw.DefaultProperty("xtype", xtype);
            jw.AddLocalizationProperty("boxLabel", boxLabel, ItemName + "BoxLabelText");
            jw.DefaultProperty("anchor", anchor);
            jw.AddLocalizationProperty("emptyText", emptyText, ItemName + "EmptyText");
            jw.DefaultProperty("readOnly", readOnly);
            jw.DefaultProperty("allowBlank", allowBlank);
            jw.DefaultProperty("inputType", inputType);
            jw.DefaultProperty("vtype", vtype);
            jw.DefaultProperty("vtypeText", vtypeText);
            jw.DefaultProperty("flex", flex);
            jw.DefaultProperty("labelAlign", labelAlign);
            jw.DefaultProperty("margin", margin);
            jw.DefaultProperty("width", width);
            jw.DefaultProperty("style", style);
            jw.DefaultProperty("fieldStyle", fieldStyle);
            jw.DefaultProperty("cls", cls);
            jw.DefaultProperty("fieldCls", fieldCls);

            jw.AddRawProperty(xtype == "checkboxfield" ? "checked" : "value", String.Format("options.data['{0}']", name));

            base.WriteProperties(jw);
        }
コード例 #2
0
        /// <summary>
        /// Write the properties from the bag to the writer. This method can be overrided for advanced scenarios.
        /// </summary>
        /// <param name="jw">The writer.</param>
        protected override void WriteProperties(DextopJsWriter jw)
        {
            if (id != dataIndex)
            {
                jw.DefaultProperty("id", id);
            }
            jw.AddLocalizationProperty("text", text, id + "Text");
            jw.AddLocalizationProperty("tooltip", tooltip, id + "TooltipText");
            jw.DefaultProperty("flex", flex);
            jw.DefaultProperty("width", width);
            jw.DefaultProperty("renderer", renderer);
            jw.DefaultProperty("format", format);
            jw.DefaultProperty("tpl", tpl);
            jw.DefaultProperty("align", align);
            jw.DefaultProperty("hidden", hidden);
            jw.DefaultProperty("sortable", sortable);

            if (_columns == null || _columns.Count == 0)
            {
                jw.AddProperty("dataIndex", dataIndex);
                jw.AddProperty("type", type);
                jw.DefaultProperty("required", required);
                jw.DefaultProperty("tooltipTpl", tooltipTpl);
                jw.DefaultProperty("readonly", readOnly);
                jw.DefaultProperty("menuDisabled", menuDisabled);
                jw.DefaultProperty("filterable", filterable);
                jw.DefaultProperty("locked", locked);
                jw.DefaultProperty("hasHeaderFilter", hasHeaderFilter);
            }
            else
            {
                jw.WritePropertyName("columns");
                jw.Write("[");
                for (var i = 0; i < _columns.Count; i++)
                {
                    if (i > 0)
                    {
                        jw.Write(", ");
                    }
                    if ((jw.Options & DextopJsWriterOptions.ItemFactory) != 0)
                    {
                        jw.Write("dict[\"{0}\"]", _columns[i].id);
                    }
                    else
                    {
                        jw.WriteObject(_columns[i]);
                    }
                }
                jw.Write("]");
            }
            base.WriteProperties(jw);
        }
コード例 #3
0
        /// <summary>
        /// Write the properties from the bag to the writer. This method can be overrided for advanced scenarios.
        /// </summary>
        /// <param name="jw">The writer.</param>
        protected override void WriteProperties(DextopJsWriter jw)
        {
            jw.DefaultProperty("itemId", itemId);
            jw.DefaultProperty("xtype", xtype);
            if (itemId != null)
            {
                jw.AddLocalizationProperty("title", title, itemId + "TitleText");
            }
            else
            {
                jw.DefaultProperty("title", title);
            }
            if (layout != null)
            {
                jw.AddProperty("layout", layout);
            }
            jw.DefaultRawProperty("defaults", defaults);
            jw.DefaultRawProperty("fieldDefaults", fieldDefaults);
            jw.DefaultProperty("margin", margin);
            jw.DefaultProperty("style", style);
            jw.DefaultProperty("bodyStyle", bodyStyle);
            jw.DefaultProperty("border", border);
            jw.DefaultProperty("autoHeight", autoHeight);
            jw.DefaultProperty("anchor", anchor);
            jw.DefaultProperty("width", width);
            jw.DefaultProperty("columnWidth", columnWidth);
            jw.DefaultProperty("flex", flex);

            base.WriteProperties(jw);
        }