Closed musabsudan closed 8 years ago
I was reading your code after I put my comment, I found you already have the base in aspnet5/Sakura.AspNet.Extensions/src/Sakura.AspNet.Mvc.PagedList/Rendering/PagerRenderingItem.cs
/// <summary>
/// Get or set all additional HTML attributes which will be applied to the generated link element.
/// </summary>
public IDictionary<string, string> LinkAttributes { get; set; }
if we can set multiple extra attributes to the link item (not the pager item) this will solve the issue. but still couldn't find where you set it. I will keep reading.
Regards
@musabsudan HI, Thank you for your comment.
Originally I've planned to support custom HTML attributes for the generated pager container and item elements (one typical usage for this design is just the AJAX support for pager links as you metioned above), however during its implementation I found it's difficult to find a good API design for both "flexiable" and "easy to use" scenes. The LinkAttributes
are correctly not used yet due to this problem.
Programmely, the pager is surrounded by a overall container, and each pager item has both a container and a link invidivually, the customization for a pager may be required at any element inside the it, and what' more, users may want to generate a completely customized different structure for their pager (to replace the original ul
-> li
-> a
structure). The the core logical information for a pager are its item layout, pager link and text generation methods, while the generation of HTML elements are working on the rendering layer. Unfortunately, there is no clean boundary between the two layers because content are always a part of the final HTML. All the above problems made the API design become very difficult.
I'm now working on a new version of pager tag helpers with completely new API models which are trying to solve the above problem, nevertheless, you are very welcome to conbribute your ideas for enhancing the flexibility of the current pager model and I'll continue maintaining the current version.
Thank you again for your kind reply and please feel free to reply :-)
Thanks for taking time to add the detailed reply. Cheers!
Closing this issue cause it seems the discussion has ended. Please feel free to reopen it if you have any new question.
yes it is Okay. actually now I am using jquery-pjax which will solve the issue nicely. I can recommend it for everyone, not only for this case. because you cannot add support for ajax in every single library that you use.
Thank you.
Thank you for your reply. Nevertheless, AJAX is a common requirement for url navigation, thus I will continue to develop the new version, and your kind comment is always very welcome ~
Hi,
Thank you for the efforts, I think it is better if you added ajax support to the pager in pagedlist tag helper, not having that is a big turn off and we need to do a workaround to support ajax.
You can add the data-ajax-*
Thanks