Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 4th, 2012  |  syntax: None  |  size: 0.86 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. jqGrid filter or search by date not working client side
  2. myGrid = $('#myGrid');
  3. myGrid.jqGrid({
  4.     caption: 'My Grid',
  5.     datatype: 'local',
  6.     data: data.rows,
  7.     height: 250,
  8.     pager: '#myPager',
  9.     viewrecords: true,
  10.     colModel: [
  11.         ...,
  12.         {
  13.             label: 'blah',
  14.             name: 'blah',
  15.             align: 'left',
  16.             sortable: true,
  17.             editable: false,
  18.             width: 85,
  19.             formatter: 'date',
  20.             sorttype: 'date',
  21.             datefmt: 'm/d/Y',
  22.             formatoptions: { srcformat: 'm/d/Y', newformat: 'm/d/Y' }
  23.         },
  24.         ...
  25.     ]
  26. });
  27.  
  28. // turn on filter toolbar
  29. myGrid.filterToolbar();
  30.        
  31. {"groupOp":"AND","rules":[{"field":"blah","op":"bw","data":"11/17/2010"}]}
  32.        
  33. (String(this.blah).substr(0,10) == String("11/17/2010"))
  34.        
  35. (String(this.blah).substr(0,10) == String("11/17/2010"))