English 中文(简体)
• 如何在客户终端管理复电?
原标题:How to manage Repeater at client end?

I have repeater control in which i have implemented Paging. Now its showing 10 data once. Now i want to manage sorting as well, using jaquery at client end means it will not hit database again for sorting.

例:显示10个项目(行文)。 每个项目都包含价格、项目数额和日期。 现在,想把这种重复性特征区分开来。 因此,只有在目前显示10个项目的情况下才能进行分类。 全方位特征(课程、项目、日期)

我在电网格中有一些样本,但没有重复工作,请让我知道如何做到这一点。 我搜查了许多东西,但一切都对我无益。

问题回答

For your solution you can visit this link

tablesorter is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. tablesorter can successfully parse and sort many types of data including linked data in a cell. It has many useful features including:

Multi-column sorting Parsers for sorting text, URIs, integers, currency, floats, IP addresses, dates (ISO, long and short formats), time. Add your own easily Support secondary "hidden" sorting (e.g., maintain alphabetical sort when sorting on other criteria) Extensibility via widget system Cross-browser: IE 6.0+, FF 2+, Safari 2.0+, Opera 9.0+ Small code size

Pseudo code:

var sortCriteria = ".Price"

var repeaterRows = $(".repeaterRows").detach();
var sortingArray = repeaterRows.map(function(key, val) {
    return {
        "jquery": $(this),
        "sort": $(this).find(sortCriteria).text();
    };
}).get();

sortingArray.sort(function(left, right) {
    return left.sort < right.sort;
});

$.each(sortingArray, function(key, val) {
    val.jquery.appendTo("#repeater");
});

首先,你从集装箱中删除重复元素。

然后,你把重复内容描绘成一个包含重复内容和内容的总结。

之后,您可使用Array.prototype.sort

Then iterate over the sorted list and append them to your repeater in the sorted order.

Yo can use Jquery tableorter plugin

Jquery

 $(document).ready(function() { 
        $(".tablesorter") 
        .tablesorter({widthFixed: true, widgets: [ zebra ]}) 
        .tablesorterPager({container: $("#pager")}); 
    });

as 标记

<table cellspacing="1" class="tablesorter">

    <thead>
        <tr>
            <th>Column1</th>
            <th>Column2</th>
            <th>Column3</th>
        </tr>
    </thead>

        <tfoot>
        <tr>
            <th>Column1</th>
            <th>Column2</th>
                         <th>Column3</th>
        </tr>

    </tfoot>
         <tbody>
                <asp:Repeater runat="server" ID="rpt_data">
                    <ItemTemplate>
            <tr>

            <td><%#Eval("ColumnName1")%></td>

            <td><%#Eval("ColumnName2")%></td>

            <td><%#Eval("ColumnName3")%></td>

            </tr>
                </ItemTemplate>
                </asp:Repeater>
         </tbody>
</table>

<div id="pager" class="pager">




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签