Hello Relvis,
It is not recommended to use ID's in the application layout. When the application is initialized, the layout is removed from the DOM and stored in a JavaScript variable. When any view that uses a layout is shown, the elements from the layout are copied/cloned into the views. Using an ID in a layout will result into having multiple elements with equal ID. This is not a valid HTML and this is the reason your code does not work.
As a solution I suggest to use a class instead of an ID. When you want to hide the button, you should get the reference to the current view (
view method) and find the element (by class) inside the header element.
For your convenience I prepared a small example:
http://jsbin.com/ufigap/2/edit
I hope this will help.
Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework -
download Kendo UI now!