/// <summary>
        ///   Setup the paging mechanism. <see cref="T:WebExtras.Core.WebExtrasConstants" />
        /// </summary>
        /// <param name="type">Pagination type to use</param>
        public virtual void SetupPaging(EPagination type)
        {
            string sDomDefault = string.Empty;

            switch (type)
            {
            case EPagination.None:
                bPaginate       = false;
                sPaginationType = null;
                iDisplayLength  = 10000;
                break;

            case EPagination.Bootstrap:
                sDomDefault = "t<'row-fluid'<'span6'i><'span6'p>>";
                goto default;

            case EPagination.Bootstrap3:
                sDomDefault = "t<'row'<'col-xs-6'i><'col-xs-6'p>>";
                goto default;

            case EPagination.Gumby:
                sDomDefault = "t<'row'<'six columns'i><'six columns'p>>";
                goto default;

            default:
                bPaginate       = true;
                sDom            = string.IsNullOrWhiteSpace(sDom) ? sDomDefault : sDom;
                sPaginationType = type.GetStringValue();
                break;
            }

            Paging = type;
        }
Beispiel #2
0
 /// <summary>
 /// <para>Defines the side pagination of table, can only be 'client' or 'server'. </para>
 /// <para>Using 'server' side requires either setting the 'url' or 'ajax' option. </para>
 /// <para>Note that the required server response format is different depending on </para>
 /// <para>whether the 'client' or 'server' option is specified.</para>
 /// </summary>
 /// <param name="spOption"></param>
 /// <returns></returns>
 public Grid SidePagination(EPagination spOption)
 {
     this._sidePagination = spOption.ToString().ToLower();
     return this;
 }