Guest User

Untitled

a guest
Jul 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. $(window).bind('resize', function() {
  2. $('#tasks').setGridWidth($(getSelectedTabHref()).width());
  3. $('#tasks').setGridHeight($(window).height()-190);
  4. }).trigger('resize');
  5.  
  6. $('#tasks').jqGrid({
  7. datatype: 'local',
  8. colNames:[labels['tasksNum'],labels['tasksAdded']+"/"+labels['tasksAccepted'],labels['tasksOperator'],labels['tasksClient'],labels['tasksManager'],labels['tasksDesc']],
  9. colModel :[
  10. {name:'taskId', index:'taskId', width:1, align:'right'},
  11. {name:'taskAdded', index:'taskAdded', width:3},
  12. {name:'taskOperator', index:'taskOperator', width:4},
  13. {name:'taskClient', index:'taskClient', width:7},
  14. {name:'taskManager', index:'taskManager', width:4},
  15. {name:'taskDesc', index:'taskDesc', width:8}]
  16. });
  17.  
  18. .ui-jqgrid .ui-jqgrid-bdiv {
  19. position: relative;
  20. margin: 0em;
  21. padding:0;
  22. /*overflow: auto;*/
  23. overflow-x:hidden;
  24. overflow-y:auto;
  25. text-align:left;
  26. }
  27.  
  28. autowidth: false,
  29. shrinkToFit: true
  30.  
  31. "autowidth" : true
  32.  
  33. "shrinkToFit": false
  34.  
  35. .ui-jqgrid .ui-jqgrid-bdiv { height: auto; margin: 0em; max-height: 250px; overflow-x: auto; overflow-y: auto; padding: 0px; position: relative; text-align: left; }
  36.  
  37. var gr = jq('#grid');
  38. gr.setGridHeight(350,true);
  39.  
  40. loadComplete: function (data) {
  41. //set our "ALL" select option to the actual number of found records
  42. $(".ui-pg-selbox option[value='ALL']").val(data.records);
  43. if ($(".ui-jqgrid").height() > $('#grid').getGridParam('maxHeight')) {
  44. //resize our grid for the vertical scroll bar to eliminate the hortizontal scroll bar
  45. $(".ui-jqgrid").css("width", $('#grid').getGridParam('width') + 20);
  46. $(".ui-jqgrid-bdiv").css("width", $('#grid').getGridParam('width') + 17);
  47. $(".ui-jqgrid-hdiv").css("width", $('#grid').getGridParam('width') + 20);
  48. $(".ui-jqgrid-view").css("width", $('#grid').getGridParam('width') + 20);
  49. $("#pager").css("width", $('#grid').getGridParam('width') + 20);
  50. $(".ui-jqgrid-hbox").css("padding-right", "16px");
  51. } else { //set everything to defaults
  52. $(".ui-jqgrid").css("width", $('#grid').getGridParam('width'));
  53. $(".ui-jqgrid-bdiv").css("width", $('#grid').getGridParam('width'));
  54. $(".ui-jqgrid-hdiv").css("width", $('#grid').getGridParam('width'));
  55. $(".ui-jqgrid-view").css("width", $('#grid').getGridParam('width'));
  56. $("#pager").css("width", $('#grid').getGridParam('width'));
  57. $(".ui-jqgrid-hbox").css("padding-right", "0px");
  58. }
Add Comment
Please, Sign In to add comment