PDA

View Full Version : Id of a component



ketanAtExt
29 Jan 2008, 7:56 AM
Hi,

I am trying to get id of a html component. I am getting the auto-assigned id. I want my own defined id. How to get that?

var deleteRowButton = new Ext.Button({
text: '<span style="color: red;font-weight: bold">X</span>',
tooltipType: "title",
tooltip: 'Delete this Row',
renderTo:deleteRowElements,
listeners:
{
click: function(deleteRowButton,e)
{
var rowNum = deleteRowButton.id;<------ I am getting default id some ext-comp-something. I want my own assigned id.

------
-------

ketanAtExt
29 Jan 2008, 8:20 AM
Can somebody please give me a hint?

devnull
29 Jan 2008, 8:30 AM
var deleteRowButton = new Ext.Button({
id: 'myButton',
text: '<span style="color: red;font-weight: bold">X</span>',
tooltipType: "title",
tooltip: 'Delete this Row',
renderTo:deleteRowElements,
...

mtlunited
29 Jan 2008, 8:33 AM
Just define your own id in the config of Ext.Button


id: 'some-id'

ketanAtExt
29 Jan 2008, 9:53 AM
Thank you both of you.

I will try that.