kendo ui - Filter the grid data is not working in FF(mozilla) and IE -


i working kendo ui controls.my functionality filter grid based on date-time , drop down selection. working on chrome not in ff , ie.

                var gridresult = $('#grid').data("kendogrid");                      var condition = {                         logic: "and",                         filters: [                             { field: "category", operator: "equals", value: $("#nw").val() },                             { field: "device", operator: "equals", value: $("#pro").val() },                             { field: "orig", operator: "equals", value: $("#work").val() },                             { field: "term", operator: "equals", value: $("#network").val() }                         ]                     };                     if (mindate !== null) {                         condition.filters.push({ field: "time", operator: "ge", value: new date(mindate) });                     }                     if (maxdate !== null) {                         maxdate = new date(maxdate);                         maxdate.sethours(23, 59, 59, 999);                         condition.filters.push({ field: "time", operator: "lt", value: maxdate });                     }                     gridresult.datasource.filter(condition);                  return false;             });          $('#fromdatetimepicker').attr('readonly', false);         $('#todatetimepicker').attr('readonly', false);       } 

when debug in firefox didn't find aby bug can 1 @ code , please tell me wrong?

i've been testing code , can't find problems it, besides have ) @ end that's because function cut larger section of code.

there several things might causing problem , there's lot of code missing can't sure. browsers try out ignoring errors make. can make work in chrome not in ff , ie. best way deal go through code , add validations confirm values every time filter method call. here suggestions you:

  • when debugging in internet explorer, use ie 11 , use f12 debugging tool.
  • you check mindate , maxdate not null, if they're undefined or contain empty value, they'll pass test , added filters though they're not set.
  • you don't have check mindate , maxdate valid dates , able create javascript date variable, before adding filter. source of error, depending on other code in script.
  • you use values $("#network").val() etc directly in filter without validating them, , cause problems in future. not causing error.

edit: encoding

you need make sure encoding of webpage correct. please make sure these 2 lines exist in head section of html code. if use asp.net mvc can add these 2 files views\shared\_layout.cshtml file. if use asp.net forms can add them in masterfile. if use php put them in head section.

<meta content="text/html;charset=utf-8" http-equiv="content-type"> <meta content="utf-8" http-equiv="encoding"> 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -