views:

1169

answers:

1

Hi,

I want to create a link in ExtJS, but one that is made of button, so, that it contains event handlers (and I don't need to add my own event handlers.)

Also, I would like to create a button that does display a big icon with text like: ICON TEXT

so that the icon is not positioned on the left side, but on the top (and is larger than the default 16x16).

+2  A: 

First, adding an event handler to a link is dead simple and requires about the same amount of code as handling a button click:

Ext.get('link-id').on('click', function(e){
  e.stopEvent(); // prevent default browser action
  // do something else
});

However, if you really want to use a button, then you'll simply want to add an id or custom class to it and use standard CSS to override the button's default style and make it look like a link.

Regarding customizing the button layout, Ext 3.0+ provides very flexible buttons layouts out of the box. Have you tried to do this and are not able (if so, post some code)? Have you looked at the button sample page?

bmoeskau