Extjs4 Dataview disable key navigation - extjs

I am using "Ext.view.ViewView" for menu. We can select menu item by arrow keys as default feature in extjs "dataview". But i need to menu item select only by click.
Is there are any way to enable selectionChange for just only click event.

I know that this is a little old but had same issue and solved by specifing a "selModel" config in my dataview
selModel: {
enableKeyNav: false
}

enableKeyNav
in ExtJS 4.1 you can add
single: true
to your event, and it will be fired only once..

Related

How to prevent text selection in an ExtJS grid cell from firing the onclick event handler and have the grid row (de-)selected as a result

In ExtJS 6.2.0. I have a standard grid. In some of the grid cells I have text that a user is able to select (for copy-paste purposes).
However, upon selection of that text (through mousedown-mouseup), also the onclick event handler of that row is fired, causing in my case the (de-)selection of that grid row.
I am looking for a way to make these text selections, but without triggering the onclick event handler.
I was thinking along the line of killing the default single click event listener, and introducing a dedicated double click event listener, but that route hasn't led to a simple solution so far.
Any suggestions?
I suggest change selectionModel to Ext.selection.CheckboxModel and set enableTextSelection in viewConfig.
selModel: {
type: 'checkboxmodel',
checkOnly: true
},
viewConfig: {
enableTextSelection: true
}
Example : https://fiddle.sencha.com/#fiddle/35o5

EXTJS: nodes deselected in multi-select tree panel on right click (itemcontextmenu)

I have a tree panel which has multiselect enabled (selModel:{MODE:MULTI}). If multiple nodes are selected then you right click to activate context menu, all selected nodes except for node that was right clicked on get deselected.
The outcome im looking for is the nodes stay selected, so I can click a menu item and get IDs of all selected Nodes.
There was a bug created for this issue couple years ago and Sencha introduced a new config, ignoreRightMouseSelection, which if set to true, doesnt treat a right click as a selection. But this config is for RowModel. I am using a tree Panel.
The event I'm listening for is treepanels "itemcontextmenu", to show contextmenu
any help appreciated, thanks
I fixed this problem by adding one more parameter to selModel.
selModel: (
{
mode: 'MULTI', ignoreRightMouseSelection:true
})
Try it.

How to programmatically fire the check change event of a ExtJS 4.1 checkbox tree panel

I have a ExtJs 4.1 check box tree panel. When I check or uncheck any node, check change event for the tree is fired. How can I programmatically fire this event.
One way I can think of is to use following code. But this code is not firing every time :-(
this.fireEvent('checkchange', node, true, opts);
Thank you
try with this event
checkchange(node, checked, eOpts)

Ext js Editor Grid Disable Multiple Row Selection

my grid allowing to select multiple row selection that is once i click on cell and press shift+arrow down button it allows me to select next set of records i wanted to disable this functionality how it can be done,on grid level how to catch keypress events and return false once shift+arrow down button is pressed
For ExtJS 3.x add this to the grid properties:
selModel: new Ext.grid.rowSelectionModel({singleSelect:true})
Grids behave as you want by default. Make sure you have NOT set multiSelect or simpleSelect to true.
Firstly, it's hard to understand your question without any punctuation. Secondly, without any code example, it's even harder to understand a question without any punctuations.
Here's my guess answer of your question:
editorgridpanel.on('keypress', function (e) {
if (e.shiftKey === true && e.getKey() === e.DOWN) {
e.stopEvent(); //this will stop the shift+down keypress event from proceeding.
}
});
The accepted answer seems to be a bit out of date. For version ExtJS4.x use this solution :
selModel: new Ext.selection.Model({mode: 'SINGLE'})
Or just use this :
selModel: {mode: 'SINGLE'}

How to add an Extra button on Extjs grid header menu

has anybody had the need to add an extra button to the grid panel header menu(sorting\columns)?
potentially I would like to add another button to the menu that resets to the default columns model. I can accomplish this using Jquery but I was wondering if there is an EXTjs way to do it.
Thanks
You need to dig through the source to see it's there, but a GridPanel has a view property which is its GridView which in turn has a hmenu property which is the menu it shows when you click on one of those column headers.
So, with a GridPanel called gridpanel (once it's rendered) you can do the following:
gridpanel.view.hmenu.add({
text: 'reset',
handler: function() {
// reset magicks
}
});

Resources