質問

An Ext.field.Toggle status can be changed programmatically using the .toggle() or .setValue() methods. This however doesn't trigger the animation on the component like it was actually dragged or tapped. Is there a way to obtain that?

役に立ちましたか?

解決

Solved it by firing tap on the underlying element of the Ext.slider.Toggle contained in the Ext.field.Toggle:

Ext.define('Fiddle.CustomToggle', {
    extend: 'Ext.field.Toggle',
    xtype : 'customtogglefield',

    toggle: function() {
        this.getComponent().element.fireEvent('tap');
    }

});

Example at https://fiddle.sencha.com/#fiddle/669

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top