FlexGrid
FlexGrid
Disable Server Reading
This sample shows what the DisableServerRead property works for.
Features
FlexGrid without paging
0
loading...
Paging FlexGrid which PageSize is set to 10
0
loading...
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 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))); } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | @ { 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) } |