Sep 20, 2013, 7:12 PM
[FIXED] [#350] Buffered GridPanel throws an error when inserting records
Hi,
I have a Buffered GridPanel with an 'Add Record' button on the top and 5000 records loaded.
When I click 'Add Record', a new Record will be inserted at index '0' of the store.
now, If I scroll down the last record on the grid and click 'Add Record', I get the error -
Below is the code to replicate the issue -
I have a Buffered GridPanel with an 'Add Record' button on the top and 5000 records loaded.
When I click 'Add Record', a new Record will be inserted at index '0' of the store.
now, If I scroll down the last record on the grid and click 'Add Record', I get the error -
SCRIPT5007: Unable to get property 'insertSibling' of undefined or null reference
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
Dim store As Store = Me.GridPanel1.GetStore()
Dim data As Object() = New Object(4999) {}
For i As Integer = 0 To 4999
data(i) = New Object() {"test" & i}
Next
store.DataSource = data
store.DataBind()
End If
End Sub
</script>
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<script type="text/javascript">
function addRecord() {
var store = this.up('gridpanel').getStore();
var newRecord = store.model.create();
store.insert(0, newRecord);
}
</script>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:GridPanel ID="GridPanel1" runat="server" Height="400">
<TopBar>
<ext:Toolbar runat="server">
<Items>
<ext:Button ID="btnAddRecord" runat="server" Icon="Add" Text="Add Record">
<listeners>
<Click Fn="addRecord" />
</listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<Store>
<ext:Store ID="Store1" runat="server" PageSize="5000">
<Model>
<ext:Model ID="Model1" runat="server">
<Fields>
<ext:ModelField Name="test" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ID="Column1" runat="server" Text="Test" DataIndex="test" />
</Columns>
</ColumnModel>
<Plugins>
<ext:BufferedRenderer ID="BufferedRenderer1" runat="server" />
</Plugins>
<Features>
<ext:GridFilters ID="GridFilters1" runat="server" Local="true">
<Filters>
<ext:StringFilter DataIndex="test" />
</Filters>
</ext:GridFilters>
</Features>
</ext:GridPanel>
</form>
</body>
</html>
Last edited by fabricio.murta; Aug 02, 2018 at 6:58 PM.