1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    3
    Vote Rating
    0
    saeedneamati is on a distinguished road

      0  

    Default Unanswered: Event driven programming in Ext JS

    Unanswered: Event driven programming in Ext JS


    I'm working on an application where different widgets from different plugins would be loaded into a host, and they don't know of each other. So I want to use EDP and in one widget raise an event (for example, UserDeleted) and in another widget, subscribe to that event (the famous publisher/subscriber, or let's get more specific, observer pattern).

    In jQuery I use trigger() and bind() methods to accomplish this. However, I'm not able to find anything equivalent in Ext JS. Am I missing something? Or is there any other pattern to create loosely coupled UI widgets in Ext JS?

    Thanks.

  2. #2
    Sencha User kevin.chen's Avatar
    Join Date
    Sep 2012
    Location
    Redwood City, CA
    Posts
    242
    Answers
    12
    Vote Rating
    6
    kevin.chen is on a distinguished road

      1  

    Default


    Ext has a class Ext.util.Observable, in old Ext version, it is parent of all component, after ExtJs 4, it is a mixin for any class which is intended to be publisher

    any class import Ext.util.Observalbe class is able to fire events and any component/class add an event listener on this instance to be able to listen this event, therefore to be notified when the event is fired. usually people who know JQuery, it is very easy to adopt ExtJs event mechanism


    http://docs.sencha.com/ext-js/4-1/#!...til.Observable

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    3
    Vote Rating
    0
    saeedneamati is on a distinguished road

      0  

    Default


    Thanks. It was exactly what I wanted. However, the documentation lacks good examples. Can you please provide some good implementation examples?

    How should I fire one of the custom events?

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar