Aug 10, 2014, 3:36 PM
[CLOSED] MVC Dynamic Buffered Store
I've been trying to create a dynamic (generated at run time) store that is buffered. However, when buffering is enabled the grid shows no rows or columns.
I'm able to reproduce the issue with the EXT MVC Infinite Scrolling Overview sample.
By changing the Index.cshtml to:
Can a dynamic store and grid be buffered?
I'm able to reproduce the issue with the EXT MVC Infinite Scrolling Overview sample.
By changing the Index.cshtml to:
@model System.Collections.IEnumerable
@{
ViewBag.Title = "Infinite Scrolling - Ext.NET MVC Examples";
Layout = "~/Views/Shared/_BaseLayout.cshtml";
}
@section example
{
<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>
@(Html.X().GridPanel()
.Width(500)
.Height(500)
.DisableSelection(true)
.Title("Stock Price")
.ID("grd")
.Store(Html.X().Store().ID("str")
.Buffered(true)
.PageSize(100)
.LeadingBufferZone(300)
.Model(Html.X().Model()
)
.Proxy(Html.X().AjaxProxy()
.Url(Url.Action("GetStockQuotations"))
.Reader(Html.X().JsonReader().Root("data"))
)
)
.ColumnModel(
)
.View(Html.X().GridView().TrackOver(false))
)
}
and the OverviewController Index code to:public ActionResult Index()
{
var g = this.GetCmp<Ext.Net.GridPanel>("grd");
var s = this.GetCmp<Store>("str");
s.Fields.Clear();
g.ColumnModel.Columns.Clear();
s.AddField(new ModelField("Company"));
s.AddField(new ModelField("Price"));
s.AddField(new ModelField("LastUpdate"));
g.AddColumn(new RowNumbererColumn { Width = 50 });
g.AddColumn(new Column { Text = "Company", DataIndex = "Company", Flex = 1 });
g.AddColumn(new Column { Text = "Price, $", DataIndex = "Price", Width = 70, Align = Alignment.Center });
g.AddColumn(new Column { Text = "Last Update", DataIndex = "LastUpdate", Width = 140, Renderer = new Renderer() { Format = RendererFormat.Date, FormatArgs = new string[] { "'n/j/Y g:i:s A'" } } });
return View();
}
If you comment out the .Buffered(true) from the store markup the first rows will be loaded.Can a dynamic store and grid be buffered?
Last edited by Daniil; Aug 12, 2014 at 5:57 AM.
Reason: [CLOSED]