首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

grid表格在form内看不到数据的有关问题

2012-12-24 
grid表格在form内看不到数据的问题??? 当grid在form内使用的时候,看不到数据,是因为form的高度为0问题造成

grid表格在form内看不到数据的问题

??? 当grid在form内使用的时候,看不到数据,是因为form的高度为0问题造成grid的数据被掩盖,因此必须给grid设置高度,或者使用js的方法给form设置高度,才能使grid的数据正常显示。

?

设置form的高度代码,其中setHeight在setUI.js定义:

?

//根据浏览器改变组件的高度function setHeight(){userAgent=window.navigator.userAgent.toLowerCase(); if (arguments.length===3){if(userAgent.indexOf("firefox")>=1 || navigator.userAgent.indexOf("Chrome")>0){var height = document.body.clientHeight;document.getElementById(arguments[0]).style.height = height - arguments[1] + 'px';}else {   var name=navigator.appName;    if(name=="Microsoft Internet Explorer"){        var height = document.body.clientHeight;        document.getElementById(arguments[0]).style.height = height - arguments[2];    }    }}else if (arguments.length===4){if(userAgent.indexOf("firefox")>=1 || navigator.userAgent.indexOf("Chrome")>0){var height = document.body.clientHeight;document.getElementById(arguments[0]).style.height = height - arguments[2] + 'px';document.getElementById(arguments[1]).style.height = height - arguments[2] + 'px';}else {   var name=navigator.appName;    if(name=="Microsoft Internet Explorer"){        var height = document.body.clientHeight;        document.getElementById(arguments[0]).style.height = height - arguments[3];        document.getElementById(arguments[1]).style.height = height - arguments[3];    }    }}}

?

另外:在grid表格必须在form中使用,否则grid.reload将不起作用!!!

热点排行