Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Dashboard
- {
- public List<Location> Locations { get; set; }
- public Filters FiltersDashboard { get; set; }
- }
- public class Filters
- {
- public bool Filter1 { get; set; }
- public bool Filter2 { get; set; }
- public bool Filter3 { get; set; }
- etc...
- }
- public ActionResult Monitor(Dashboard dashboard)
- {
- if(dashboard.Filters == null)
- {
- dashboard.Filters = new FiltersGSA();
- }
- return View(dashboard);
- }
- [HttpPost]
- public async Task<ActionResult> Zoeken(Dashboard data, int current, int rowcount, Dictionary<string, string> sort)
- {
- return Json(await DataService.Search(data, current, rowcount, sort));
- }
- $("#searchform").submit(function (event) {
- search();
- event.preventDefault();
- });
- function search() {
- var model = @Html.Raw(Json.Encode(Model))
- $("#grid-data").bootgrid("destroy");
- $("#preloader").show();
- $("#grid-data").bootgrid({
- ajax: true,
- url: '@Url.Content("~/SlimmeMeter/Zoeken")',
- type: "POST",
- data: JSON.stringify(model),
- rowCount: -1,
- multiSort: true,
- formatters: {
- "DateOnly": function (column, row) {
- return Rendo.displayJsonDate(row[column.id]);
- }
- },
- responseHandler: function (response) {
- if (response.error) {
- $("#errorMessage").show("slow");
- $("#errorMessagePlaceholder").html(response.message);
- }
- else {
- //Eventueel error bericht verwijderen
- $("#errorMessage").hide("slow");
- }
- $("#preloader").hide();
- return response;
- },
- requestHandler: function (request) {
- return request;
- },
- });
- };
Add Comment
Please, Sign In to add comment