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

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)

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

ExtJS5: TreePanel select event firing twice

I made a Fiddle test case to reproduce my problem: the select event is fired twice. Even the selectionchange does so. But the cellclick is fired only once.
I use ExtJS5.1.1 GPL.
NB: the Load button (on the left) has to be clicked first.
This looks like a bug...
An ugly workaround can be using buffer. You can set the listener like this:
select: {
buffer: 1,
fn: function(treepanel, record, index) {
console.log('select', index);
}
}
The listener is added to the events twice, this is a bug in Sencha Framework that relates to the locked/normal treegrid and is fixed in 5.1.2. It seems as if the listener is added once to the listener object of the locked grid and once to the listener object of the normal grid, and because both grids use the very same object, that object will contain the listener twice.
A quick fix seems to be to remove the select listener from the listener config and add it to one of the grids only:
Ext.ComponentQuery.query('viewport treepanel[isLocked=true]')[0].on('select', function(treepanel, record, index) {
console.log('select', index);
});

Extjs4 Dataview disable key navigation

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..

ExtJS 3 Checkbox Click Listener

Right now I have change listener but it requires the checkbox to lose focus to register. I looked around online and was unable to find out if such listener (or better substitute) exists.
Is there anyway at all to create a click listener?
Have you tried check?
http://docs.sencha.com/ext-js/3-4/#!/api/Ext.form.Checkbox-event-check

Extjs Combo Box get previous value?

Trying to get the previous value of the combo box. I tried 'change' event, but it does not work. 'beforeselect' does not exist for the new extjs 4.0 if i am not wrong. Any ideas on how i can do this?
I understand we can use the change event, but that only happens when the user types something. I want to check if there is an previous value on each new select?
It's kind of weird that there is no beforeselect event. However, combobox extends picker and every picker has selectionModel with beforeselect event. So you may assign handler to picker selModel's beforeselect event:
MyCombo.getPicker().getSelectionModel()
.on('beforeselect',function(sm, selections, i) {
console.log(sm.lastSelected, selections, i);
});
You can also get the previous value of the combo from valueModels of the combo object in beforeselect event.
beforeselect: function(combo, record, index, eOpts){
me.prevCountry = combo.valueModels[0].data.COUNTRY_ID;
}
you can use change event handler that pass this params to your listener ( combo, newValue, oldValue )

Resources