Вопрос

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