aftab123401 / jsgantt

Automatically exported from code.google.com/p/jsgantt
0 stars 0 forks source link

More flexible event handlers #21

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Use prototypes event handlers or otherwise to allow javascript function
call for "onclick" event rather than a http link.  Allow for ajax request
etc...

Original issue reported on code.google.com by stay0...@gmail.com on 22 Jan 2009 at 6:50

GoogleCodeExporter commented 8 years ago
Something like this. 

observe: function(eventName, handler) {
    this.input.observe('JSGantt:' + eventName, handler.bind(this));
    return this;
  }

fire: function(eventName, memo) {
    memo = memo || { };
    memo.JSGantt = this;
    return this.input.fire('JSGantt:' + eventName, memo);
  }

// To set up an observer
JSGantt.observe("element:added", function() {
                    // Ajax request or whatever here
                });
// To manually fire the event
JSGantt.fire("element:added");

Original comment by stay0...@gmail.com on 28 Jan 2009 at 3:17

GoogleCodeExporter commented 8 years ago
I think that this feature it's really important becuase the gantt chart in any 
case 
will be used as a control and it will need to interact with others objects in 
the 
web client.
I agree with this enhancement.

Original comment by rodolfoa...@gmail.com on 12 Oct 2009 at 8:45