使用 extjs javascript 锁定 CFGRID 中的列
我正在尝试创建一个带有锁定列的 cfgrid (Coldfusion 9)。 我查看了代码 http://dev .sencha.com/deploy/ext-4.0.0/examples/grid/locking-grid.html 可以看到我需要设置的属性是 'locked' = true...
这是 javascript 代码:
<cfsavecontent variable="headContent">
<script type="text/javascript">
function init()
{
var myGrid = ColdFusion.Grid.getGridObject('gridData');
//turn on the grid panel's lockable option - not sure if this is needed or not
myGrid.lockable = true;
//get the column model
cm = myGrid.getColumnModel();
//lock the first two columns in the grid
for(var i=0; i < 2; i++) {
var thisid = cm.getColumnId(i);
var thiscol = cm.getColumnById(thisid);
thiscol.locked = true;
//for (prop in thiscol){ document.write("object." + prop + " = " + thiscol[prop] + "<br>");}
}
//refresh the grid
ColdFusion.Grid.refresh('gridData',false);
}
</script>
</cfsavecontent>
我不明白任何错误..但也没有得到我锁定的列。 我知道我可以使用这个特定的 javascript 代码影响网格的属性 - 我尝试设置 thiscol.sortable = false ,这确实使对列进行排序的功能变灰。
有什么想法吗?
I am trying to create a cfgrid (Coldfusion 9) with locked columns.
I looked at the code at http://dev.sencha.com/deploy/ext-4.0.0/examples/grid/locking-grid.html and can see that the property I need to set is 'locked' = true...
here is the javascript code:
<cfsavecontent variable="headContent">
<script type="text/javascript">
function init()
{
var myGrid = ColdFusion.Grid.getGridObject('gridData');
//turn on the grid panel's lockable option - not sure if this is needed or not
myGrid.lockable = true;
//get the column model
cm = myGrid.getColumnModel();
//lock the first two columns in the grid
for(var i=0; i < 2; i++) {
var thisid = cm.getColumnId(i);
var thiscol = cm.getColumnById(thisid);
thiscol.locked = true;
//for (prop in thiscol){ document.write("object." + prop + " = " + thiscol[prop] + "<br>");}
}
//refresh the grid
ColdFusion.Grid.refresh('gridData',false);
}
</script>
</cfsavecontent>
I don't get any errors..but don't get my locked columns either.
I know I can affect the properties of the grid using this particular javascript code - I tried setting thiscol.sortable = false and that did indeed grey out the ability to sort the column.
any ideas??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过下载 extjs 4 并创建所需的 js 代码解决了我的问题。
I solved my problem by downloading extjs 4 and creating the js code needed..