Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Paging (PageIndex and PageSize)
hnchan
#1 Posted : Sunday, June 13, 2010 6:01:20 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 5/16/2010(UTC)
Posts: 36
Location: HK
Hi

Where could I find the pageindex and page size as this page mentioned. Thanks.

http://www.kooboo.com/do...l/Kooboo-content-paging

Alex
luiz@wise.com.br
#2 Posted : Monday, June 14, 2010 7:39:43 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 3/4/2010(UTC)
Posts: 157
Location: brazil
This are parameters in the url, take a look at this document http://www.kooboo.com/documents/detail/quick_start_v_1_2_ in the detail page, in chapter 5
hnchan
#3 Posted : Monday, June 14, 2010 8:59:52 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 5/16/2010(UTC)
Posts: 36
Location: HK
Thanks but pageIndex and pageSize column still now shown? Why? Is something I missed?
luiz@wise.com.br
#4 Posted : Monday, June 14, 2010 9:02:30 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 3/4/2010(UTC)
Posts: 157
Location: brazil
how did you configure the url?
hnchan
#5 Posted : Monday, June 14, 2010 10:41:14 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 5/16/2010(UTC)
Posts: 36
Location: HK
Add following under the page

advanced URL

{contentId}_{pageIndex}

but no pageIndex shown under data rule of the content template.



luiz@wise.com.br
#6 Posted : Monday, June 14, 2010 10:48:10 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 3/4/2010(UTC)
Posts: 157
Location: brazil
Do you mean the columns don't show?

if is that just click in any column drop down button, then select columns and them check the columns you want to show
hnchan
#7 Posted : Wednesday, June 16, 2010 3:36:32 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 5/16/2010(UTC)
Posts: 36
Location: HK
Thanks. It works now after click on the columns. However, this helper still not works.

<%=this.Html.CmsPager(PageSize, PageIndex, TotalCount)%>

It seems the parameters are 0 now, How could we assign the values to them? Thanks.
luiz@wise.com.br
#8 Posted : Wednesday, June 16, 2010 8:59:41 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 3/4/2010(UTC)
Posts: 157
Location: brazil
can you send me a complete example?
hnchan
#9 Posted : Friday, June 18, 2010 10:21:32 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 5/16/2010(UTC)
Posts: 36
Location: HK
Here it is.

<%@ Control Language="C#" Inherits="Everest.CmsServices.MvcHelper.CmsUserControl" %>
<!-- Body -->

<div class="content_body">
<h1 class="site_logo"><a href="index.html"><img style="width:320px" src="/template/webapp/binaryresource/mpaper_new/images/logo-banner.jpg" alt="mpaper.tv" /></a></h1>
<ul class="news_list_other">
<% foreach (var item in this.GetContents("NewsByCat"))
{%>
<li class="news_list_thread">
<div class="thumb">
<a href="/web2/Detail/<%=item["ContentId"].ToString() %>">
<img class="thumb_img" alt='<%=item["Title"]%>' src='<%=item["Thumbnail"] == "" ? "/template/webapp/binaryresource/mpaper_new/images/logo-icon.jpg":Url.Content(item["Thumbnail"].ToString())%>' /></a>
</div>
<div class="content_r">
<a href="/web2/Detail/<%=item["ContentId"].ToString() %>">
<h3 class="text"><%=item["Title"].ToString()%></h3>
<div class="timestamp">&nbsp;</div>
</a>
</div>
</li>
<%}%>
</ul>
<%=this.Html.CmsPager(PageSize, PageIndex, TotalCount)%>
<%= ViewData["Tweet"] %>
</div>
luiz@wise.com.br
#10 Posted : Friday, June 18, 2010 11:56:07 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 3/4/2010(UTC)
Posts: 157
Location: brazil
I'll try to do this here
luiz@wise.com.br
#11 Posted : Saturday, June 19, 2010 2:00:54 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 3/4/2010(UTC)
Posts: 157
Location: brazil
I made it work, but I'm not sure if it's correct, maybe Guoqi or Jifeng can give a better explanation

First I created a content template like this

Code:

<%@ Control Language="C#" Inherits="Everest.CmsServices.MvcHelper.CmsUserControl" %>
<script runat=server>
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (!StringExtensions.IsNullOrEmptyTrim(Request.QueryString["pageSize"]))
{
PageSize = int.Parse(Request.QueryString["pageSize"]);
}
}
</script>

<div class="content_body">
<ul class="news_list_other">
<% foreach (var item in this.GetContents("Test"))
{%>
<li class="news_list_thread">
<div class="thumb">
<%=item["Title"]%>
</div>
</li>
<%}%>
</ul>
<%=this.Html.CmsPager(PageSize, PageIndex, TotalCount)%>
<% %>
</div>



then I put this in the page Url {PageIndex}/{PageSize}, and the default PageIndex=0&PageSize=2 (Page Size Didn't work as well as I imagined but ok)

I also Created two data rules one called test to get me the list, and another called TotalCount to return the count

the deal is this:

the property PageIndex gets the value from the querystring automatically, the TotalCount also gets its value from the datarule called TotalCount
but the page size don't, so I needed to put this onLoad Code in the content template

it works but i'm not sure it's correct

hnchan
#12 Posted : Tuesday, June 22, 2010 8:18:09 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 5/16/2010(UTC)
Posts: 36
Location: HK
thanks.
jifeng
#13 Posted : Wednesday, June 23, 2010 9:53:02 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
The solution from luiz is very correct.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
luiz@wise.com.br
#14 Posted : Wednesday, June 23, 2010 8:53:55 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 3/4/2010(UTC)
Posts: 157
Location: brazil
thanks
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.571 seconds.