This is a migrated thread and some comments may be shown as answers.

Set a Layout to a View in Javascript

3 Answers 95 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Relez
Top achievements
Rank 1
Relez asked on 11 Feb 2013, 04:42 PM

I have this situation:

I have some Views and by default they have assigned a Layout for them. The problem is that in some specific cases, I need to change the Layout of some of these Views in the Javascript file.

I am using this way:

$("#tabstrip-dash").setAttribute('data-layout', 'mobile-tabstrip-layout2');

This solution works only if I reload the application, but I want to change it instantly.

Is there any way to set the new Layout?

Thanks!

3 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 13 Feb 2013, 04:22 PM
Hi Relvis,

I am afraid that what you would like to achieve is not supported. Replacing the layout at runtime is not possible. Could you please explain why you want to change it? Probably I would be able to suggest an alternative solution.

Kind 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!
0
Relez
Top achievements
Rank 1
answered on 13 Feb 2013, 09:44 PM
Hi Alexander, I have this situation:

I have the following layout to all my views. In my application I have a login screen that permit the user authenticated. They have different roles, and I should hide the OPTION button of the layout to some of the users. This is the layout:

<div data-role="layout" id="mobile-tabstrip" data-id="mobile-tabstrip">
  <header data-role="header">
    <div data-role="navbar">
      <a data-align="left" data-role="backbutton">Back</a>
      <span data-role="view-title">Application</span>
      <a id="menu-option-button" data-click="smMenuClicked" data-align="right" data-role="button">Option</a>
    </div>
    </header>
            
  <div data-role="footer">
    <div data-role="tabstrip">
      <a href="#tabstrip-home" data-icon="home">Home</a>
    </div>
  </div>
</div>


I have tried to hide it using Javascript:

$("#menu-option-button").css('display', 'none');

But no luck.

Thanks!
0
Alexander Valchev
Telerik team
answered on 15 Feb 2013, 02:14 PM
Hi Relvis,

Thank you for the feedback.

I have already replied to your question in the other forum thread that you opened. Here is a link.

Kind 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!
Tags
General Discussions
Asked by
Relez
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Relez
Top achievements
Rank 1
Share this question
or