p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   SharePoint Development (http://p2p.wrox.com/forumdisplay.php?f=213)
-   -   this.attributes.add not working (http://p2p.wrox.com/showthread.php?t=68840)

millerthegorilla June 17th, 2008 03:23 AM

this.attributes.add not working
 
Hi - I've added the following to my webpart

this.attributes.add("onmousedown","bob()");

and this to render()

this.attributes.addattribute(writer);

The attribute gets rendered in the source code but for some reason is added to the webn part below, so when I mousedown on the webpart below mine the javascript function bob() gets called. Am I doing something wrong?

millerthegorilla June 17th, 2008 03:44 AM

I've found the problem - I added a div element in render that contains all my controls and called this.attributes.addattribute after this div. For some reason that meant the attribute was getting added to the next webpart. I simply called this.attributes.addatribute at the beginning of render() before I rendered anything else.



All times are GMT -4. The time now is 01:52 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.