This content has been marked as final. Show 3 replies
When you use the <component> element, you are creating a custom component and cannot use an ID. But within that component "this" should allow your component to refer to itself, and you could refer to it outside the component using the itemRenderer property of the DataGridColumn.
Thanks for the reply.
I was able to access it using "this" property when I use the Script tags inside the component.
But Could you please provide me with a sample code of how to access it if I am using the script tags outside the component. I am calling the method on the click using the outerDocument but how do I access the label property of the button.
Ahh, you really don't want do that. Item renderers are ephemeral creatures. You can't count on them existing when you want them.
Now, a suggestion. Instead of calling the method, have your renderer dispatch an event. For simplicity, have it bubble. Add a listener for it on the main app. Make the method a handler, and in that you can access the Button using the event.target property. From that you can get the label.
One more possibility: pass the value you want to your method as arguments: