PDA

View Full Version : onclick on xtype Label



missgextjs
17 Nov 2010, 12:00 AM
I have 2 texts like:

1. Artist Info
2. Album Info

In HTML code I can using onclick method by <a href="javascript:void(0)" onclick="javascript:alert('what if')"> to alert message.

example:

<a href="javascript:void(0)" onclick="javascript:alert('what if')"> Artist </a>


But in EXTJS I can't do it. My code like these:


{
xtype: 'fieldset',
title: 'Request',
style: 'text-align:left',
layout: 'form',
items: [

{
xtype: 'label',
id: 'artist_info',
html: '<a href="javascript:void(0)" onclick="javascript:openAritstWindow()"> Artist Info</a>',
anchor: '100%'
},
{
xtype: 'label',
id: 'artist_info',
html: '<a href="javascript:void(0)" onclick="javascript:openAlbumWindow()"> Album Info</a>',
anchor: '100%'
}
] }


And other way I can't using Ext.getCmp('artist_info).on('click', function() { alert("aritstttt") })


Anyone please help