Guest User

Untitled

a guest
Feb 6th, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. <?php
  2. /**
  3. * PHP Grid Component
  4. *
  5. * @author Abu Ghufran <gridphp@gmail.com> - http://www.phpgrid.org
  6. * @version 1.5.2
  7. * @license: see license.txt included in package
  8. */
  9.  
  10. include_once("../../config.php");
  11.  
  12. include(PHPGRID_LIBPATH."inc/jqgrid_dist.php");
  13.  
  14. // '$db_conf' database configuration is loaded from config.php
  15. $g = new jqgrid($db_conf);
  16.  
  17. $grid["caption"] = "Sample Grid";
  18. $grid["autowidth"] = true;
  19. $grid["loadComplete"] = 'function(){gridload();}';
  20.  
  21. $g->set_options($grid);
  22.  
  23. $g->table = "clients";
  24.  
  25. $out = $g->render("list1");
  26. ?>
  27. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  28. <html>
  29. <head>
  30. <link rel="stylesheet" type="text/css" media="screen" href="../../lib/js/themes/redmond/jquery-ui.custom.css"></link>
  31. <link rel="stylesheet" type="text/css" media="screen" href="../../lib/js/jqgrid/css/ui.jqgrid.css"></link>
  32.  
  33. <script src="../../lib/js/jquery.min.js" type="text/javascript"></script>
  34. <script src="../../lib/js/jqgrid/js/i18n/grid.locale-en.js" type="text/javascript"></script>
  35. <script src="../../lib/js/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>
  36. <script src="../../lib/js/themes/jquery-ui.custom.min.js" type="text/javascript"></script>
  37. </head>
  38. <body>
  39. <div>
  40. <?php echo $out?>
  41. </div>
  42.  
  43. <script>
  44. function gridload(){
  45.  
  46. jQuery("th.ui-state-default.ui-th-column.ui-th-ltr input").each( function(){
  47.  
  48. $(this).keyup(function(){
  49.  
  50. if ($(this).val() != '')
  51. {jQuery(this).css('background-color','red');}
  52. else
  53. {jQuery(this).css('background-color','white');}
  54.  
  55. });
  56.  
  57. } );
  58.  
  59. }
  60. </script>
  61. </body>
  62. </html>
Add Comment
Please, Sign In to add comment