Advertisement
dropbox1349

index.html (Flexigrid)

Nov 9th, 2014
456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  6. <title>Flexigrid</title>
  7. <link rel="stylesheet" href="style.css" />
  8. <link rel="stylesheet" type="text/css" href="../css/flexigrid.pack.css" />
  9. <script type="text/javascript"
  10. src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
  11. <script type="text/javascript" src="../js/flexigrid.pack.js"></script>
  12. </head>
  13.  
  14.  
  15. <table class="flexme3" style="display: none"></table>
  16.  
  17. <script type="text/javascript">
  18. jQuery().ready(function (){
  19.    
  20. $(function() {
  21. $(".flexme3").flexigrid(
  22. {
  23. url: 'scripts/agenzie_json.php',
  24. dataType: 'json',
  25. colModel : [
  26. {display: 'ID', name : 'IDagenzie', width : 40, sortable : false, align: 'left'},
  27. {display: 'Denominazione', name : 'agenzia', width : 300, sortable : true, align: 'left'},
  28. {display: 'Comune', name : 'agenzia_comune', width : 180, sortable : true, align: 'left'},
  29. {display: 'Telefono', name : 'agenzia_telefono', width : 120, sortable : false, align: 'left'}
  30. ],
  31. buttons : [
  32. {name: 'Edit', bclass: 'edit', onpress : doCommand},
  33. {name: 'Delete', bclass: 'delete', onpress : doCommand},
  34. {separator: true}
  35. ],
  36. searchitems : [
  37. {display: 'Denominazione', name : 'agenzia', isdefault: true},
  38. {display: 'Comune', name : 'agenzia_comune'}
  39. ],
  40. sortname: "agenzia",
  41. sortorder: "asc",
  42. usepager: true,
  43. title: "Agenzie esterne",
  44. useRp: true,
  45. rp: 10,
  46. showTableToggleBtn: false,
  47. resizable: false,
  48. width: 700,
  49. height: 370,
  50. singleSelect: true
  51. }
  52. );
  53. });
  54.  
  55. function doCommand(com, grid) {
  56. if (com == 'Edit') {
  57. $('.trSelected', grid).each(function() {
  58. var id = $(this).attr('id');
  59. id = id.substring(id.lastIndexOf('row')+3);
  60. alert("Edit row " + id);
  61. });
  62. } else if (com == 'Delete') {
  63. $('.trSelected', grid).each(function() {
  64. var id = $(this).attr('id');
  65. id = id.substring(id.lastIndexOf('row')+3);
  66. alert("Delete row " + id);
  67. });
  68. }
  69. }
  70.    
  71. });
  72. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement