Default Event for Custom Widget.

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
Nathan
New User
Posts: 1
Joined: Thu May 10, 2012 3:51 pm
First Name: Nathan
Last Name: Crews
Company Name: ICS
Contact:

Default Event for Custom Widget.

Post by Nathan »

Hello,

can anyone tell me ( or point to the documentation if i'm missing it) how to create a custom widget with a default click event?

I've tried.
defaults: {
"onclick": "alert('HI!');"
}

in both pui.widgets.add() and pui.toolbox.add() with no luck.

I'm looking to create a quick widget to include on pages. This widget will just be an element (say a div) with an background image that will alert some values when clicked.

Thanks
-Nathan
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Default Event for Custom Widget.

Post by David »

I've attached an example of creating an image widget with certain image applied and an onclick event.

To install, remove the ".txt" extension and place here:

/www/profoundui/htdocs/profoundui/userdata/custom/widgets

The widget will appear in the last category Custom Widgets.

See docs here:

http://www.profoundlogic.com/docs/displ ... evelopment

I thought the image widget was an easy way to do what you described, but if you really want a <div> element, just use the output field widget as your base, and then assign a "css class" property to attach a class where you can define the background image.
Attachments
example.js.txt
(1013 Bytes) Downloaded 182 times
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests