对这个不需要拉宽的列设置一个自己定义的属性
autoResize="false"
然后用document.getElementById()读取即可
autoResize="false"
然后用document.getElementById()读取即可
解决方案 »
- 将数据写入json文件
- 问题,如何判断调用页面是否正常?
- Jquery easyui combotree跟.net集成开发
- 全局变量aaaaa如何=function Sub_RSVP(bbbbb) 的问题
- 一段小Javascript的代码中的小问题
- 梅花雨大人.请教一个关于树形控件问题.
- js 变量定义问题, 很搞人, 郁闷
- 如何判断一个对象是否存在?
- 我想在表单中能增加或删除文本框!高分相送!
- 为什么不能写<script />
- insertRow()插入的动态表格激发的onmouseover 能alert出来东西却不能改变动态表格行的颜色。是怎么回事情
- 怎样调用另一页面的JAVASCRIPT
JS特菜,还是不懂你说的代码添那里
如上代如存为 a.htc表格调用
<table style="behavior: url(a.htc)">
<tr>
<td>111</td>
<td>222</td>
<td>333</td>
<td>444</td>
<td>555</td>
</tr>
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
<td>d</td>
<td>e</td>
</tr>
</table>假如我想111列和555列不允许拖动,麻烦指点一下该怎做,谢谢
<PUBLIC:COMPONENT>
<PUBLIC:ATTACH EVENT="oncontentready" ONEVENT="fnInit()" />
<PUBLIC:ATTACH EVENT="onclick" ONEVENT="fnClick()" />
<METHOD NAME="menubarpush"/>
<SCRIPT LANGUAGE="JScript">
function fnInit()
{
for(var i=0;i<element.rows.length;i++)
{
var _tr = element.rows[i];
for(var j=0;j<_tr.cells.length;j++)
{
if(i==0)
{
_tr.attachEvent("onmousedown", fnMousedown);
_tr.attachEvent("onmousemove",fnMousemove);
_tr.attachEvent("onmouseover",fnMouseover);
_tr.attachEvent("onselectstart",fnCancel);
window.document.attachEvent("onmouseup", fnMouseup);
window.document.attachEvent("onmousemove",fnMouseMove);
}
} }
var _line = window.document.createElement("DIV");
_line.style.position = "absolute";
_line.style.backgroundColor="Silver";
_line.style.width=1;
window.document.body.appendChild(_line);
element.splitLine = _line;
element.splitLine.style.display = "none";
}
function fnMouseover()
{
return;
}
function fnMouseMove(){
if(!element.splitlocked) return;
fnMousemove();
}
function fnMousemove(){
var oEl = event.srcElement;
element.splitLine.style.left = window.event.x;
element.splitLine.style.top = getTop(element);
element.splitLine.style.height = element.parentElement.clientHeight;
if(oEl.autoResiz=="false") return;
if(element.splitlocked) return;
if(!IfSplitLocation(oEl)) return;
}
function fnClick(){
var oEl = event.srcElement;
}
function fnMousedown(){
var oEl = event.srcElement;
if(oEl.autoResiz=="false") return;
if(!IfSplitLocation(oEl)) return;
element.splitLine.style.display = "";
element.splitlocked = true;
window.document.attachEvent("onselectstart",fnCancel);
}
function fnMouseup()
{
element.splitLine.style.display = "none";
element.splitlocked = false;
element.document.body.style.cursor='default';
if(element.curResizeTD == null) return;
if(element.curResizeTD.autoResiz=="false")return;
var otd = element.curResizeTD;
var otdLeft = getLeft(otd);
var otdwidth = element.splitLine.style.pixelLeft - otdLeft
if(otdwidth < 0) return;
otd.style.width = otdwidth;
window.document.detachEvent("onselectstart",fnCancel);
}
function IfSplitLocation(oEl)
{
if(oEl.tagName == "DIV")
oEl = oEl.parentElement;
if(oEl.tagName == "TD")
{
if(Math.abs(event.offsetX - oEl.clientWidth) <= 5)
{
element.curResizeTD = oEl;
element.document.body.style.cursor='col-resize';
}
else if (Math.abs(event.offsetX) <= 5 && oEl.cellIndex>0){
if(oEl.cellIndex>0){
element.curResizeTD = oEl.parentElement.cells(oEl.cellIndex-1);
element.document.body.style.cursor='col-resize';
}
// else if(oEl.autoResiz=="false"){
//return false;
//}
}
else{
element.curResizeTD = null;
element.document.body.style.cursor='default';
return false;
}
}
return true;
}
function getTop(e){
var t=e.offsetTop;
while(e=e.offsetParent){
t+=e.offsetTop;
}
return t;
}
function getLeft(e){
var l=e.offsetLeft;
while(e=e.offsetParent){
l+=e.offsetLeft;
}
return l;
}
function fnCancel()
{
window.event.returnValue = false;
return false;
}
</SCRIPT>
</PUBLIC:COMPONENT>
A.htm
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD><BODY>
<table style="behavior: url(a.htc)" border="1">
<tr>
<td autoResiz="false">111</td>
<td autoResiz="true" >222</td>
<td autoResiz="true" >333</td>
<td autoResiz="true" >444</td>
<td autoResiz="false"555</td>
</tr>
</table></BODY>
</HTML>
这个我想是不是个缓存的问题!
GRIDVIEW这个我不熟悉!我也是刚学js才一个星期!所以不能帮上忙!请你见谅