Guest User

Untitled

a guest
Dec 30th, 2015
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. <script src="https://rawgit.com/jeresig/jquery.hotkeys/master/jquery.hotkeys.js" type="text/javascript"></script>
  2.  
  3. <script>
  4. jQuery(document).ready(function(){
  5.  
  6. // where list1 is your grid id
  7. $(document).bind('keydown', 'e', function assets() {
  8. $('#edit_list1').click();
  9. return false;
  10. });
  11.  
  12. });
  13. </script>
  14.  
  15. --- COMPLETE CODE --
  16.  
  17. <?php
  18. /**
  19. * PHP Grid Component
  20. *
  21. * @author Abu Ghufran <gridphp@gmail.com> - http://www.phpgrid.org
  22. * @version 1.5.2
  23. * @license: see license.txt included in package
  24. */
  25.  
  26. include_once("../../config.php");
  27.  
  28. mysql_connect(PHPGRID_DBHOST, PHPGRID_DBUSER, PHPGRID_DBPASS);
  29. mysql_select_db(PHPGRID_DBNAME);
  30.  
  31. include(PHPGRID_LIBPATH."inc/jqgrid_dist.php");
  32.  
  33. $g = new jqgrid();
  34. $grid["caption"] = "Sample Grid";
  35. $grid["autowidth"] = true;
  36.  
  37. $g->set_options($grid);
  38.  
  39. $g->table = "clients";
  40.  
  41. $out = $g->render("list1");
  42. ?>
  43. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  44. <html>
  45. <head>
  46. <link rel="stylesheet" type="text/css" media="screen" href="../../lib/js/themes/redmond/jquery-ui.custom.css"></link>
  47. <link rel="stylesheet" type="text/css" media="screen" href="../../lib/js/jqgrid/css/ui.jqgrid.css"></link>
  48.  
  49. <script src="../../lib/js/jquery.min.js" type="text/javascript"></script>
  50. <script src="../../lib/js/jqgrid/js/i18n/grid.locale-en.js" type="text/javascript"></script>
  51. <script src="../../lib/js/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>
  52. <script src="../../lib/js/themes/jquery-ui.custom.min.js" type="text/javascript"></script>
  53. <script src="https://rawgit.com/jeresig/jquery.hotkeys/master/jquery.hotkeys.js" type="text/javascript"></script>
  54.  
  55. <script>
  56. jQuery(document).ready(function(){
  57.  
  58. // where list1 is your grid id
  59. $(document).bind('keydown', 'e', function assets() {
  60. $('#edit_list1').click();
  61. return false;
  62. });
  63.  
  64. });
  65. </script>
  66.  
  67. </head>
  68. <body>
  69. <div>
  70. <?php echo $out?>
  71. </div>
  72.  
  73.  
  74. </body>
  75. </html>
Add Comment
Please, Sign In to add comment