PDA

View Full Version : [CLOSED] FilterHeader and InfiniteScrolling gives javascript error.



Arohan
Dec 30, 2014, 5:33 AM
I am getting an error when FilterHeader and InfiniteScrolling is used.

I have gone through the discussions on

http://forums.ext.net/showthread.php?25829-OPEN-308-FilterHeader-and-infinite-scrolling

This does not solve my problem. Is this issue solved in Version 2.5 Or 3.0

Please guide.

Daniil
Dec 30, 2014, 6:13 AM
Hi @Arohan,


I am getting an error when FilterHeader and InfiniteScrolling is used.

Please clarify what is the error? What is the steps to reproduce? What is the test case?:)


I have gone through the discussions on
http://forums.ext.net/showthread.php?25829-OPEN-308-FilterHeader-and-infinite-scrolling

This does not solve my problem.


Please clarify what exactly have you tried so far?


Is this issue solved in Version 2.5 Or 3.0

It is unlikely fixed in 2.5, because ExtJS 4.2.2 has not been incorporated to Ext.NET.

As for Ext.NET v3, soon I will be testing all the v2 issues with v3 and post follow-ups in the forum threads with information it is still reproducible or not.

Arohan
Dec 30, 2014, 7:31 AM
Hi Daniil,

Following is the source code,


<%@ Page Language="C#" %>

<script runat="server">
protected void Store_ReadData(object sender, StoreReadDataEventArgs e)
{
Store store = (Store)sender;
System.Collections.Generic.List<StockQuotation> data = new System.Collections.Generic.List<StockQuotation>();

int start = e.Start,
limit = e.Limit;
Random randow = new Random();
DateTime now = DateTime.Now;

for (int i = start + 1; i <= start + limit; i++)
{
StockQuotation qoute = new StockQuotation()
{
Company = "Company " + i,
Price = randow.Next(0, 200),
LastUpdate = now
};

data.Add(qoute);
}
store.Data = data;
e.Total = 50000;
}

class StockQuotation
{
public string Company { get; set; }
public int Price { get; set; }
public DateTime LastUpdate { get; set; }
}
</script>

<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<title>Infinite Scrolling - Ext.NET Examples</title>
<link href="/resources/css/examples.css" rel="stylesheet" />
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<h1>
Infinite Scrolling</h1>
<p>
Ext.Net 2's brand new grid supports infinite scrolling, which enables you to load
any number of records into a grid without paging.</p>
<p>
The new grid uses a virtualized scrolling system to handle potentially infinite
data sets without any impact on client side performance.</p>
<ext:GridPanel ID="GridPanel1" runat="server" Width="500" Height="500" Title="Stock Price">
<Store>
<ext:Store ID="Store1" runat="server" Buffered="true" PageSize="200" TrailingBufferZone="10"
LeadingBufferZone="10" OnReadData="Store_ReadData">
<Proxy>
<ext:PageProxy>
<Reader>
<ext:JsonReader Root="data" />
</Reader>
</ext:PageProxy>
</Proxy>
<Model>
<ext:Model ID="Model1" runat="server">
<Fields>
<ext:ModelField Name="Company" />
<ext:ModelField Name="Price" />
<ext:ModelField Name="LastUpdate" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:RowNumbererColumn ID="RowNumbererColumn1" runat="server" Width="50" />
<ext:Column ID="Column1" runat="server" Text="Company" DataIndex="Company" Flex="1" />
<ext:Column ID="Column2" runat="server" Text="Price, $" DataIndex="Price" Width="70"
Align="Center" />
<ext:Column ID="Column3" runat="server" Text="Last Update" DataIndex="LastUpdate"
Width="140">
<Renderer Format="Date" FormatArgs="'n/j/Y g:i:s A'" />
</ext:Column>
</Columns>
</ColumnModel>
<View>
<ext:GridView ID="GridView1" runat="server" TrackOver="false" />
</View>
<Plugins>
<ext:FilterHeader ID="FilterHeader1" runat="server" Remote="true">
</ext:FilterHeader>
</Plugins>
<SelectionModel>
<ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" Mode="Multi"
ShowHeaderCheckbox="false">
</ext:CheckboxSelectionModel>
</SelectionModel>
</ext:GridPanel>
</form>
</body>
</html>


I have added FilterHeader Plugin And used CheckBoxSelectionModel with Mode="Multi"

Now when I Click Checkbox and Select couple of records it works fine
17881

But, As soon as I try to filter it gives Javascript Error: Type Error: c is undefined and Shows empty grid
Please see the image
17891

Please help.

Dimitris
Dec 30, 2014, 9:13 AM
Can you please remove the JsonReader from the store's proxy and check again? Just use:



<Proxy>
<ext:PageProxy/>
</Proxy>


On a side note, you are trying to use Remote filtering. I am not sure if this what you really want in your example :)
The http://examples2.ext.net/#/GridPanel/FilterHeader/Remote/ and http://examples2.ext.net/#/GridPanel/Infinite_Scrolling/Remote_Filter/ examples use different approaches.

Arohan
Dec 30, 2014, 3:17 PM
I tried your solution, but still it gives same error

Dimitris
Dec 30, 2014, 6:26 PM
Can you please provide your source code again (with all your latest changes) since it works for me and I cannot investigate further?