Hi Team,
I am working on a Client-Side paging grid (ServerOperation(false)). However, the web still send a request to the server when I click the paging and sorting button. Also, the filter doesn't work. I can see the filter icon, but when I click on it, nothing happens.
My view:
@model IEnumerable<INSYNC_Test.Models.Staffs>
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
@(Html.Kendo().Grid(Model).Name("staffs").Columns(c =>
{
c.Bound(p => p.Firstname);
c.Bound(p => p.Lastname);
c.Bound(p => p.JobTitle);
})
.DataSource(d=>d
.Ajax()
.ServerOperation(false)
)
.Pageable()
.Filterable()
.Sortable()
)
My controller:
using INSYNC_Test.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace INSYNC_Test.Controllers
{
public class testController : Controller
{
// GET: test
public ActionResult Index()
{
var db = new OSHODSEntities();
var staffs = db.Staffs.Select(p => new Models.Staffs
{
ID = p.ID,
Firstname = p.Firstname,
Lastname = p.Lastname,
JobTitle = p.JobTitle,
locat = p.locat,
dept = p.dept,
status = p.status,
});
return View(staffs);
}
}
}
my viewmodel:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace INSYNC_Test.Models
{
public class Staffs
{
public int ID { get; set; }
public string Firstname { get; set; }
public string Lastname { get; set; }
public string JobTitle { get; set; }
public string locat { get; set; }
public string dept { get; set; }
public int status { get; set; }
}
}