1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- //(function ($) {
-
- //})(jQuery)
- function autoResize(c) {
- var a = {
- width: 6,
- height: 119,
- gridType: "jqgrid"
- };
- c = $.extend(a, c);
- var d = b();
- if ($.isFunction(c.callback)) {
- c.callback(d);
- }
- $(window).resize(function () {
- var e = b(true);
- switch (c.gridType) {
- case "datagrid":
- $(c.dataGrid).datagrid("resize", {
- width: e.width,
- height: e.height
- });
- break;
- case "treegrid":
- $(c.dataGrid).treegrid("resize", {
- width: e.width,
- height: e.height
- });
- break;
- case "jqgrid":
- $(c.dataGrid).jqGrid("setGridHeight", e.height).jqGrid("setGridWidth", d.width);
- break;
- }
- });
- function b(e) {
- var g = 0;
- var f = 0;
- if (typeof (window.innerHeight) == "number") {
- g = window.innerHeight;
- f = window.innerWidth;
- } else {
- if (document.documentElement && document.documentElement.clientHeight) {
- g = document.documentElement.clientHeight;
- f = document.documentElement.clientWidth;
- } else {
- if (document.body && document.body.clientHeight) {
- g = document.body.clientHeight;
- f = document.body.clientWidth;
- }
- }
- }
- f -= c.width;
- g -= c.height;
- return {
- width: f,
- height: g
- };
- }
- };
|