PDA

View Full Version : Grid with locked columns no longger response to 'itemdblclick'



ihiyas
22 Sep 2011, 1:16 AM
here's my code:


var data =[[1,"000811121267","Jacky",185.37,207.79],
[1,"000811121268","Tommy",185.37,207.79],
[1,"000811121269","Lucy",185.37,207.79]];
var store = new Ext.data.SimpleStore({data:data, fields:["id","no","name", "day01", "day02"]});
var myGrid = Ext.create('Ext.grid.Panel',{
renderTo:"hello",
title:"click with locked",
width: 300,
height: 150,
columns:[
{header:"number", dataIndex:"no"},
{header:"name", dataIndex:"name"},
{header:"day1", dataIndex:"day01", width:70},
{header:"day2", dataIndex:"day02", width:70}],
store:store,
listeners:{
'itemdblclick' : function(){alert(7);} //works!
}
});

when i dblclicked on the rows, '7' alerted,
But, if i lock any of the columns, such as:


{header:"number", dataIndex:"no", locked:true}

then it no longger response to my clicks.:s
how could i solve this problem,
thank you!

whalethewise
1 Dec 2011, 3:23 PM
Try to put your itemdblclick listener from grid Panel listeners into viewConfig listeners. Worked for my itemcontextmenu.



viewConfig: {
listeners: {
itemdblclick: docListContextMenu
}
},


If you want listener to work only in locked part use viewLockedConfig. If only in unlocked part use viewNormalConfig

joelchu
2 Dec 2011, 7:06 AM
I had the same problem as well.

Thanks for this info.

But another one creep up - tab navigation died.

error I got




Uncaught TypeError: Cannot call method 'getHeaderAtIndex' of undefinedExt.define.startEditByPositionext-all-debug-w-comments.js:120825Ext.define.onEditorTabext-all-debug-w-comments.js:128243Ext.define.onSpecialKeyext-all-debug-w-comments.js:120763fireext-all-debug-w-comments.js:16976Ext.define.continueFireEventext-all-debug-w-comments.js:21172Ext.define.fireEventext-all-debug-w-comments.js:21145Ext.define.onSpecialKeyext-all-debug-w-comments.js:88315fireext-all-debug-w-comments.js:16976Ext.define.continueFireEventext-all-debug-w-comments.js:21172Ext.define.fireEventext-all-debug-w-comments.js:21145Ext.define.fireKeyext-all-debug-w-comments.js:96219(anonymous function)wrap



using 4.07