FlexGrid
Disable Server Reading
Features
Sample
FlexGrid without paging
Paging FlexGrid which PageSize is set to 10
Settings
Description
This sample shows what the DisableServerRead property works for.
When it is set to True, all the items will be transferred to the client side. Sorting, paging or filtering will be done in the client side.
And the text like "Loading..." is not shown for loading the data when the scrollbar scrolls.
Otherwise, sorting, paging or filtering will be done in server side. And sometimes the "Loading..." text will be shown.
Source
DisableServerReadController.cs
using System.Collections.Generic; using C1.Web.Mvc; using Microsoft.AspNetCore.Mvc; using MvcExplorer.Models; using C1.Web.Mvc.Serialization; using Microsoft.AspNetCore.Http; namespace MvcExplorer.Controllers { public partial class FlexGridController : Controller { private readonly ControlOptions _disableServerReadSetting = new ControlOptions { Options = new OptionDictionary { {"Disable Server Read",new OptionItem{Values = new List<string> {"True", "False"},CurrentValue = "True"}} } }; public ActionResult DisableServerRead(IFormCollection collection) { _disableServerReadSetting.LoadPostData(collection); ViewBag.DemoOptions = _disableServerReadSetting; return View(); } public ActionResult DisableServerRead_Bind([C1JsonRequest] CollectionViewRequest<Sale> requestData) { return this.C1Json(CollectionViewHelper.Read(requestData, Sale.GetData(500))); } } }
DisableServerRead.cshtml
@{ ControlOptions optionsModel = ViewBag.DemoOptions; ViewBag.DemoSettings = true; } <h4>@Html.Raw(FlexGridRes.DisableServerRead_Text0)</h4> <c1-flex-grid id="dsrFlexGrid" auto-generate-columns="true" class="grid" is-read-only="true"> <c1-flex-grid-filter></c1-flex-grid-filter> <c1-items-source disable-server-read="@(Convert.ToBoolean(optionsModel.Options["Disable Server Read"].CurrentValue))" initial-items-count="10" read-action-url="@Url.Action("DisableServerRead_Bind")"></c1-items-source> </c1-flex-grid> <br /> <br /> <h4>@Html.Raw(FlexGridRes.DisableServerRead_Text1)</h4> <c1-flex-grid id="dsrPagingGrid" auto-generate-columns="true" height="300px" style="height:auto" class="grid" is-read-only="true"> <c1-flex-grid-filter></c1-flex-grid-filter> <c1-items-source disable-server-read="@(Convert.ToBoolean(optionsModel.Options["Disable Server Read"].CurrentValue))" page-size="10" read-action-url="@Url.Action("DisableServerRead_Bind")"></c1-items-source> </c1-flex-grid> <c1-pager owner="dsrPagingGrid"></c1-pager> @section Settings{ @await Html.PartialAsync("_OptionsMenu", optionsModel) } @section Description{ @Html.Raw(FlexGridRes.DisableServerRead_Text2) }
Documentation