can we write any function after click apply button

HI,
can we write any function after apply button click ,
i want write below code to get row column value after apply button click

$$("pivot").attachEvent("onPopup", function(popup){
     var rows = popup.$$("rows");
     var fields = popup.$$("fields");
     var filters = popup.$$("filters");
     var columns = popup.$$("columns");
     // ...
});

Hi,

Pivot popup fires onApply event:

$$("pivot").attachEvent("onPopup", function(popup){
     popup.attachEvent("onApply", doSomething);
});

function doSomething(structure){
     var rows = popup.$$("rows");
     var fields = popup.$$("fields");
     var filters = popup.$$("filters");
     var columns = popup.$$("columns");
     // ...
}

Hi maria,
thank you for replying .
I am using below code but getting Uncaught TypeError: Cannot read property ‘apply’ of undefined exception on console .
kindly guide me how can i get row ,column value after click on apply button

$$(“pivot”).attachEvent(“onPopup”, function(popup){

	 popup.attachEvent("onApply", doSomething(popup));

});

 function doSomething(popup){
     var rows = popup.$$("rows");
     var fields = popup.$$("fields");
     var filters = popup.$$("filters");
     var columns = popup.$$("columns");
     alert(rows);
}

Please correct the handler definition as follows:


$$("pivot").attachEvent("onPopup", function(popup){
     popup.attachEvent("onApply", doSomething);
});

 function doSomething(structure){
     // 'this' refers to popup here
     var rows = this.$$("rows");
     var fields = this.$$("fields");
     var filters = this.$$("filters");
     var columns = this.$$("columns");
     alert(rows);
}