clicksToEdit CFGRID

846 Views Asked by At

I have been searching all over the place for this and only found my question which has gone unanswer for sometime.

Using ColdFusion 8's cfgrid tag. By default, the edit mode requires you to double-click on a cell to render edit mode. Why? I don't get it.

Now, what I would like to do is change the click amount to 1 instead of two.

I looked in the EXT-JS documentation and it is clicksToEdit for the grid; however, I have yet to find a way...without editing the base grid.js file to make it a single click.

I dont want to edit the core files to accomplish this. Any suggestions?

Here is my code....

 init = function(){
    //grid object 

    grid = ColdFusion.Grid.getGridObject('ActivityGrid');

    //column model 

    cm = grid.getColumnModel();

    //we need to know the column id 

    entIndex = cm.findColumnIndex("DATE_START");
    intIndex = cm.findColumnIndex("DATE_END");

    var ef = new Ext.form.DateField(
        {
            format: 'm/d/Y',
            minValue: '1/01/11'
        }
    );


    //set format for the cell
    cm.setEditor(entIndex, new Ext.grid.GridEditor(ef));
    cm.setEditor(intIndex, new Ext.grid.GridEditor(ef));

    //set render for the cell
    cm.setRenderer(entIndex, Ext.util.Format.dateRenderer('m/d/Y'));
    cm.setRenderer(intIndex, Ext.util.Format.dateRenderer('m/d/Y'));

    grid.reconfigure(grid.getDataSource(),cm);
    }
1

There are 1 best solutions below

0
On

With Ext JS 3.0 with unbounded grid, grid.getDataSource() throw an error

Object doesn't support property or method getDataSource

The workaround is to use grid.getStore()
So, replace line

grid.reconfigure(grid.getDataSource(),cm);

with

grid.reconfigure(grid.getStore(),cm);