Instead of all that query
ugliness, you can just use:
item.down('.x-leave-request-edit')
.
To make it not visible the initially, just add display: none;
in the inline style.
return '<a href="#" style="display: none;" class="x-leave-request-edit">Edit</a>';