开发者

Locking columns in CFGRID using extjs javascript

开发者 https://www.devze.com 2023-03-08 07:05 出处:网络
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 t

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 k开发者_运维知识库now 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??


I solved my problem by downloading extjs 4 and creating the js code needed..

0

精彩评论

暂无评论...
验证码 换一张
取 消