[ 1 post ]

Brian McCullough

  • Username: bdmc
  • Joined: Fri May 22, 2009 11:05 am
  • Posts: 64
  • IRC: bdmc
  • Offline
  • Profile
Tags:

buttonClickEvent side effects?

Post Posted: Thu Apr 01, 2010 1:41 pm
+0-
I have a datatable ( scrolling data table ) in which I have a column whose data is a URL, but I have created a formatter that shows it as a "<button>" with a label. "elCell.innerHTML = '<button >Click Here</button >'".

I also have the following function:

Code:
 Y.notesDataTable.subscribe( "buttonClickEvent", function(oArgs){
        var elButton = oArgs.target;
        var oRecord = this.getRecord(elButton);
        var myData = oRecord.getData();
        window.open( myData.ref_url, 'Orig', 'address=yes,toolbar=yes,scrollbars=yes,location=yes,statusbar=yes,menubar=yes,resizable=yes', true );
        alert( "got here" );
        return true;
    });


As expected, I get a new window containing the contents of the web page pointed to by myData.ref_url, and I get the alert message now that I have added it for debugging.

What I also seem to be getting is a reload of the whole page enclosing the Data Table, which is NOT wanted.

I have tried "return false" and "return true" with no effect.

The API documentation doesn't say anything about the effect of buttonClickEvent, only that it fires.


I am sure that this will look like Javascript 101, but it is unexpected, to me at least, and I would appreciate guidance.

Any suggestions?


Thanks,
Brian
  [ 1 post ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum