Пример #1
0
 public AjaxPager(AjaxHelper helper, ViewContext viewContext, Options options, AjaxOptions ajaxOptions, RouteValueDictionary valueDictionary)
 {
     this.ajaxHelper = helper;
     this.viewContext = viewContext;
     this.options = options;
     this.ajaxOptions = ajaxOptions;
     this.linkWithoutPageValuesDictionary = valueDictionary;
 }
Пример #2
0
 public static string Pager(this AjaxHelper ajaxHelper, Options options, AjaxOptions ajaxOptions, RouteValueDictionary valuesDictionary)
 {
     if (valuesDictionary == null)
     {
         valuesDictionary = new RouteValueDictionary();
     }
     if (options.ActionName != null)
     {
         if (valuesDictionary.ContainsKey("action"))
         {
             throw new ArgumentException("The valuesDictionary already contains an action.", "actionName");
         }
         valuesDictionary.Add("action", options.ActionName);
     }
     var pager = new AjaxPager(ajaxHelper, ajaxHelper.ViewContext, options, ajaxOptions, valuesDictionary);
     return pager.RenderHtml();
 }
Пример #3
0
 public Pager(ViewContext viewContext, Options options, RouteValueDictionary valuesDictionary)
 {
     this.viewContext = viewContext;
     this.options = options;
     this.linkWithoutPageValuesDictionary = valuesDictionary;
 }
Пример #4
0
 /// <summary>
 /// Create Pager with different type of options like custom page title, tooltip, font size, controls option.
 /// <example>
 /// <code>
 /// <para>new Options {</para>
 /// <para>    PageSize = Model.PageSize,</para>
 /// <para>    TotalItemCount = Model.TotalItemCount,</para>
 /// <para>    CurrentPage = Model.PageNumber,</para>
 /// <para>    ItemTexts = new ItemTexts() { Next = "Next", Previous = "Previous", Page = "P" },</para>
 /// <para>    TooltipTitles = new TooltipTitles() { Next = "Next page", Previous = "Previous page", Page = "Page" },</para>
 /// <para>    Size = Size.normal,</para>
 /// <para>    Alignment = Alignment.centered,</para>
 /// <para>    IsShowControls = true },</para>
 /// <para>new AjaxOptions {</para>
 /// <para>    UpdateTargetId = "grid-list",</para>
 /// <para>    OnBegin = "beginPaging",</para>
 /// <para>    OnSuccess = "successPaging",</para>
 /// <para>    OnFailure = "failurePaging" },</para>
 /// <para>new { filterParameter = ViewData["foo"] })</para>
 /// </code> 
 /// </example>
 /// </summary>
 /// <param name="htmlHelper"></param>
 /// <param name="options"></param>
 /// /// <param name="ajaxOptions"></param>
 /// <param name="values">
 /// Set your fileter parameter
 /// <code>
 /// new { parameterName = ViewData["foo"] }
 /// </code>
 /// </param>
 /// <returns></returns>
 public static string Pager(this AjaxHelper ajaxHelper, Options options, AjaxOptions ajaxOptions, object values)
 {
     return Pager(ajaxHelper, options, ajaxOptions, new RouteValueDictionary(values));
 }
Пример #5
0
 /// <summary>
 /// Create Pager with different type of options like custom page title, tooltip, font size, controls option.
 /// <example>
 /// <code>
 /// <para>new Options {</para>
 /// <para>    PageSize = Model.PageSize,</para>
 /// <para>    TotalItemCount = Model.TotalItemCount,</para>
 /// <para>    CurrentPage = Model.PageNumber,</para>
 /// <para>    ItemTexts = new ItemTexts() { Next = "Next", Previous = "Previous", Page = "P" },</para>
 /// <para>    TooltipTitles = new TooltipTitles() { Next = "Next page", Previous = "Previous page", Page = "Page" },</para>
 /// <para>    Size = Size.normal,</para>
 /// <para>    Alignment = Alignment.centered,</para>
 /// <para>    IsShowControls = true</para>
 /// <para>}, new { filterParameter = ViewData["foo"] })</para>
 /// </code> 
 /// </example>
 /// </summary>
 /// <param name="htmlHelper"></param>
 /// <param name="options"></param>
 /// <param name="values">
 /// Set your fileter parameter
 /// <code>
 /// new { parameterName = ViewData["foo"] }
 /// </code>
 /// </param>
 /// <returns></returns>
 public static string Pager(this HtmlHelper htmlHelper, Options options, object values)
 {
     return Pager(htmlHelper, options, new RouteValueDictionary(values));
 }