SpreadJS Documentation
bind Method
The event type.
Optional. Specifies additional data to pass along to the function.
Specifies the function to run when the event occurs.
Binds an event to the sheet.
Syntax
var instance = new GcSpread.Sheets.Sheet(name);
var value; // Type: any
value = instance.bind(type, data, fn);
function bind( 
   type : string,
   data : Object,
   fn : Function
) : any;

Parameters

type
The event type.
data
Optional. Specifies additional data to pass along to the function.
fn
Specifies the function to run when the event occurs.
Example
This example binds events.
sheet.bind(GcSpread.Sheets.Events.LeftColumnChanged,function(event,data)
  {
    var str = "----------------------------------------\n";
    var title = "Event [LeftColumnChanged ] Fired";
    str = str.substr(0, 4) + title + str.substr(4 + title.length);
    if (typeof data == "object") {
        for (var key in data) {
            str += key + " : " + data[key] + "\n";
          }
      } else {
        str += data + "\n";
      }
      alert(str);
  });
sheet.bind(GcSpread.Sheets.Events.TopRowChanged,function(event,data)
  {
        var str = "----------------------------------------\n";
        var title = "Event [TopRowChanged] Fired";
        str = str.substr(0, 4) + title + str.substr(4 + title.length);
        if (typeof data == "object") {
            for (var key in data) {
                str += key + " : " + data[key] + "\n";
            }
        } else {
            str += data + "\n";
        }
        alert(str);
    });
See Also

Reference

Sheet type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.