May 18, 2015, 11:40 AM
[CLOSED] How to get column header name on grid panel cell's right click
I am creating a grid panel dynamically. While creating am locking the first 3 columns. So that the horizontal scroll bar starts from the 4th column. I have context menu implemented for the grid which should not be enabled for the locked columns. I have an event written inside the view config of a grid like below to prevent the right click:
<ViewConfig>
<Listeners>
<CellContextMenu Fn="preventRightClick" />
</Listeners>
</ViewConfig>
Function definition: preventRightClick = function (view, td, cellIndex, record, tr, rowIndex, e){
var abc = #{grdETSummary};
#{HdnColumnIndex}.setValue(cellIndex);
if((cellIndex == "0")||(cellIndex == "1")||(cellIndex == "2"))
{
#{tier1SummaryMenu}.disable();
#{tier2SummaryMenu}.disable();
}
else
{
#{tier1SummaryMenu}.enable();
#{tier2SummaryMenu}.enable();
}
e.preventDefault();
}
The problem is after locking the first 3 (0,1,2) columns, the column index of the 4th column in the javascript function again starts from 0 instead of starting from 3. So as per my grid, the columns 3,4,5 also disables the context menu. If I can get the column header name in the click event then I can restrict it from being disabled. Please tell me how do I get the column header name WITHOUT USING THE COLUMN INDEX.!! Well, if I had to use the column index to find the column header again it results in the same way as the unlocked column index starts from 0.
Last edited by Daniil; May 26, 2015 at 4:50 PM.
Reason: [CLOSED]