开发者

Problem with filtring data ExtNet&Json

I'm a beginner with asp.net and Ext.net i would like to develop some rich interfaces but i have some problems, i'm using Ext.Net to do this, i get m开发者_开发技巧y data from a web service which return Json object the problem it's that i have paging so i don't recuperate all my data i only recuperate the necessary per page (remote paging),for example : 30data per page, the problem i have it's concerning filtering i don't know how can i proceed to filter all data and display it. I think that i have to recuperate all data and then do the filter, but the problem its that i have a lot of data (so performance ...), and i don't have any idea to retrieve solution.I need your help please :) Thanks, and have a nice day


I think you just need to pass the 'start' and 'limit' parameters. Then server-side, your data service will read these params and filter your data accordingly.

The following sample demonstrates a typical Store configuration.

Example

<ext:Store runat="server" RemoteSort="true">
    <Proxy>
        <ext:HttpProxy Method="GET" Url="../../Shared/PlantHandler.ashx" />
    </Proxy>
    <AutoLoadParams>
        <ext:Parameter Name="start" Value="0" />
        <ext:Parameter Name="limit" Value="5" />
    </AutoLoadParams>
    <Reader>
        <ext:JsonReader Root="Data" TotalProperty="TotalRecords">
            <Fields>
                <ext:RecordField Name="Common" />
                <ext:RecordField Name="Botanical" />
                <ext:RecordField Name="Light" />
                <ext:RecordField Name="Price" Type="Float" />
                <ext:RecordField Name="Availability" Type="Date" />
                <ext:RecordField Name="Indoor" Type="Boolean" />
            </Fields>
        </ext:JsonReader>
    </Reader>
    <SortInfo Field="Common" Direction="ASC" />
</ext:Store> 

Here's a few server-side paging/sorting examples which might help:

JSON returned from .ashx handler

http://examples.ext.net/#/GridPanel/Paging_and_Sorting/Handler/

JSON returned from an XML WebService

http://examples.ext.net/#/GridPanel/Paging_and_Sorting/JSON_WebService/

XML returned from an XML WebService

http://examples.ext.net/#/GridPanel/Paging_and_Sorting/XML_WebService/

Hope this helps.


If you are storing your data in a SQL database, so you should not care about performance... because SQL Engine can filter data from so many records in less than a second!
If you wanna filter data in client side, I suggest you to use JQuery .hide and .show methods. So you'll get the best performance as you are doing everything in client-side.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜