Beispiel #1
0
        /// <summary>
        /// Gets the script descriptors.
        /// </summary>
        /// <returns>Returns the ScriptDescriptors which are associated with this control</returns>
        protected override IEnumerable <ScriptDescriptor> GetScriptDescriptors()
        {
            ScriptControlDescriptor desc = CreateDescriptor();

            ScriptDescriptorHelper.AddTempateHtml(desc, "headerTemplate", HeaderTemplate);
            ScriptDescriptorHelper.AddTempateHtml(desc, "itemTemplate", ItemTemplate);
            ScriptDescriptorHelper.AddTempateHtml(desc, "separatorTemplate", SeparatorTemplate);
            ScriptDescriptorHelper.AddTempateHtml(desc, "alternatingItemTemplate", AlternatingItemTemplate);
            ScriptDescriptorHelper.AddTempateHtml(desc, "footerTemplate", FooterTemplate);

            if (Animate)
            {
                if (AnimationDuration != DefaultAnimationDuration)
                {
                    desc.AddProperty("animationDuration", AnimationDuration);
                }

                if (AnimationFps != DefaultAnimationFps)
                {
                    desc.AddProperty("animationFps", AnimationFps);
                }
            }
            else
            {
                desc.AddProperty("animate", Animate);
            }

            ScriptDescriptorHelper.AddEvent(desc, "itemCreated", ItemCreatedEvent);
            ScriptDescriptorHelper.AddEvent(desc, "itemDataBound", ItemDataBoundEvent);
            ScriptDescriptorHelper.AddEvent(desc, "itemCommand", ItemCommandEvent);

            yield return(desc);
        }
Beispiel #2
0
        /// <summary>
        /// Gets the script descriptors.
        /// </summary>
        /// <returns>Returns the ScriptDescriptors which are associated with this control</returns>
        protected override IEnumerable <ScriptDescriptor> GetScriptDescriptors()
        {
            ScriptControlDescriptor desc = CreateDescriptor();

            ScriptDescriptorHelper.AddTempateHtml(desc, "headerTemplate", HeaderTemplate);
            ScriptDescriptorHelper.AddTempateHtml(desc, "itemTemplate", ItemTemplate);
            ScriptDescriptorHelper.AddTempateHtml(desc, "separatorTemplate", SeparatorTemplate);
            ScriptDescriptorHelper.AddTempateHtml(desc, "alternatingItemTemplate", AlternatingItemTemplate);
            ScriptDescriptorHelper.AddTempateHtml(desc, "footerTemplate", FooterTemplate);
            ScriptDescriptorHelper.AddTempateHtml(desc, "selectedItemTemplate", SelectedItemTemplate);
            ScriptDescriptorHelper.AddTempateHtml(desc, "editItemTemplate", EditItemTemplate);

            ScriptDescriptorHelper.AddStyle(desc, "headerStyle", HeaderStyle);
            ScriptDescriptorHelper.AddStyle(desc, "itemStyle", ItemStyle);
            ScriptDescriptorHelper.AddStyle(desc, "separatorStyle", SeparatorStyle);
            ScriptDescriptorHelper.AddStyle(desc, "alternatingItemStyle", AlternatingItemStyle);
            ScriptDescriptorHelper.AddStyle(desc, "footerStyle", FooterStyle);
            ScriptDescriptorHelper.AddStyle(desc, "selectedItemStyle", SelectedItemStyle);
            ScriptDescriptorHelper.AddStyle(desc, "editItemStyle", EditItemStyle);

            if (!ShowHeader)
            {
                desc.AddProperty("showHeader", ShowHeader);
            }

            if (!ShowFooter)
            {
                desc.AddProperty("showFooter", ShowFooter);
            }

            if (AllowDragAndDrop)
            {
                desc.AddProperty("allowDragAndDrop", AllowDragAndDrop);
            }

            if (DragOpacity != DefaultDragOpacity)
            {
                desc.AddProperty("dragOpacity", DragOpacity);
            }

            if (Animate)
            {
                if (AnimationDuration != DefaultAnimationDuration)
                {
                    desc.AddProperty("animationDuration", AnimationDuration);
                }

                if (AnimationFps != DefaultAnimationFps)
                {
                    desc.AddProperty("animationFps", AnimationFps);
                }
            }
            else
            {
                desc.AddProperty("animate", Animate);
            }

            if (RepeatColumns > 0)
            {
                desc.AddProperty("repeatColumns", RepeatColumns);
            }

            if (RepeatDirection != DataListRepeatDirection.Vertical)
            {
                desc.AddScriptProperty("repeatDirection", typeof(DataListRepeatDirection).FullName + "." + RepeatDirection.ToString());
            }

            if (EditItemIndex != DefaultIntegerProperty)
            {
                desc.AddProperty("editItemIndex", EditItemIndex);
            }

            if (SelectedIndex != DefaultIntegerProperty)
            {
                desc.AddProperty("selectedIndex", SelectedIndex);
            }

            ScriptDescriptorHelper.AddProperty(desc, "dataKeyField", DataKeyField);

            ScriptDescriptorHelper.AddEvent(desc, "itemDragStart", ItemDragStartEvent);
            ScriptDescriptorHelper.AddEvent(desc, "itemDropped", ItemDroppedEvent);
            ScriptDescriptorHelper.AddEvent(desc, "itemDataBound", ItemDataBoundEvent);
            ScriptDescriptorHelper.AddEvent(desc, "selectedIndexChanged", SelectedIndexChangedEvent);
            ScriptDescriptorHelper.AddEvent(desc, "editCommand", EditCommandEvent);
            ScriptDescriptorHelper.AddEvent(desc, "updateCommand", UpdateCommandEvent);
            ScriptDescriptorHelper.AddEvent(desc, "cancelCommand", CancelCommandEvent);
            ScriptDescriptorHelper.AddEvent(desc, "deleteCommand", DeleteCommandEvent);
            ScriptDescriptorHelper.AddEvent(desc, "itemCommand", ItemCommandEvent);

            yield return(desc);
        }
Beispiel #3
0
        /// <summary>
        /// Gets the script descriptors.
        /// </summary>
        /// <returns>Returns the ScriptDescriptors which are associated with this control</returns>
        protected override IEnumerable <ScriptDescriptor> GetScriptDescriptors()
        {
            ScriptControlDescriptor desc = CreateDescriptor();

            ScriptDescriptorHelper.AddStyle(desc, "infoStyle", InfoStyle);
            ScriptDescriptorHelper.AddStyle(desc, "currentPageStyle", CurrentPageStyle);
            ScriptDescriptorHelper.AddStyle(desc, "otherPageStyle", OtherPageStyle);

            if (FirstPageText != DefaultFirstPageText)
            {
                desc.AddProperty("firstPageText", FirstPageText);
            }

            if (PreviousPageText != DefaultPreviousPageText)
            {
                desc.AddProperty("previousPageText", PreviousPageText);
            }

            if (NextPageText != DefaultNextPageText)
            {
                desc.AddProperty("nextPageText", NextPageText);
            }

            if (LastPageText != DefaultLastPageText)
            {
                desc.AddProperty("lastPageText", LastPageText);
            }

            if (ShowInfo)
            {
                desc.AddProperty("showInfo", ShowInfo);
            }

            if (!ShowFirstAndLast)
            {
                desc.AddProperty("showFirstAndLast", ShowFirstAndLast);
            }

            if (ShowPreviousAndNext)
            {
                desc.AddProperty("showPreviousAndNext", ShowPreviousAndNext);
            }

            if (!ShowNumeric)
            {
                desc.AddProperty("showNumeric", ShowNumeric);
            }

            if (PageSize != DefaultPageSize)
            {
                desc.AddProperty("pageSize", PageSize);
            }

            if (PageIndex != DefaultPageIndex)
            {
                desc.AddProperty("pageIndex", DefaultPageIndex);
            }

            if (!UseSlider)
            {
                desc.AddProperty("useSlider", UseSlider);
            }

            if (SliderSize != DefaultSliderSize)
            {
                desc.AddProperty("sliderSize", SliderSize);
            }

            if (!HideOnSinglePage)
            {
                desc.AddProperty("hideOnSinglePage", HideOnSinglePage);
            }

            ScriptDescriptorHelper.AddEvent(desc, "pageChanged", PageChangedEvent);

            yield return(desc);
        }