Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to replace div using jquery and kendo ui
    primarykey
    data
    text
    <p>i'm doing some tests, to do that i took a template on the kendo ui' page. i clean it a bit to get what i want and right now, i have two div header in my html page. i remove one at the load of the page and when i click on a button, i just want to remove the current header et set another one instead. i've tried plenty of things but nothing seems to work correctly using jquery</p> <p>here is my code:</p> <pre><code> &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Demo&lt;/title&gt; &lt;link href="styles/kendo.common.min.css" rel="stylesheet" /&gt; &lt;link href="styles/kendo.default.min.css" rel="stylesheet" /&gt; &lt;link href="styles/kendo.mobile.all.min.css" rel="stylesheet" /&gt; &lt;link href="styles/index.css" rel="stylesheet" /&gt; &lt;script src="js/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="js/kendo.all.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;!-- Contenu des pages chargées par le paneau left --&gt; &lt;body&gt; &lt;div data-role="view" id="drawer-home" data-layout="drawer-layout" data-title="Inbox" &lt;p&gt;recherche &lt;/p&gt; &lt;/div&gt; &lt;div data-role="view" id="drawer-starred" data-layout="drawer-layout" data-title="Starred Items"&gt; &lt;p&gt;recherche &lt;/p&gt; &lt;/div&gt; &lt;div data-role="view" id="drawer-drafts" data-layout="drawer-layout" data-title="Drafts"&gt; &lt;p&gt;recherche &lt;/p&gt; &lt;/div&gt; &lt;div data-role="drawer" id="my-drawer" style="width: 270px" data-views="['/', 'drawer-home', 'drawer-starred', 'drawer-drafts']"&gt; &lt;ul data-role="listview" data-type="group" &lt;li&gt;Menu &lt;ul&gt; &lt;li&gt;&lt;a href="#drawer-home" data-transition="none"&gt;m1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#drawer-starred" data-transition="none"&gt;m2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#drawer-drafts" data-transition="none"&gt;m3&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class="Head" data-role="layout" data-id="drawer-layout"&gt; &lt;header data-role="header"&gt; &lt;div class="" data-role="navbar"&gt; &lt;a data-role="button" data-rel="drawer" href="#my-drawer" data-icon="drawer-button" data-align="left"&gt;&lt;/a&gt; &lt;span id="compagnyName"&gt;Demo&lt;/span&gt; &lt;a data-role="button" onClick="changeHead()" data-icon="drawer-button" data-align="right"&gt;&lt;/a&gt; &lt;/div&gt; &lt;/header&gt; &lt;/div&gt; &lt;div class="HeadSearching" data-role="layout" data-id="drawer-layout"&gt; &lt;header data-role="header"&gt; &lt;div data-role="navbar"&gt; &lt;a data-role="button" data-rel="drawer" href="#my-drawer" data-icon="drawer-button" data-align="left"&gt;&lt;/a&gt; &lt;input type="text" id="city" name="city" class="k-textbox" placeholder="Ville" data-align="center" /&gt; &lt;select name="country" id="country" data-align="right"&gt; &lt;option&gt;France&lt;/option&gt; &lt;option&gt;Angleterre&lt;/option&gt; &lt;option&gt;Luxembourg&lt;/option&gt; &lt;option&gt;Espagne&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;/header&gt; &lt;/div&gt; &lt;script&gt; var app = new kendo.mobile.Application(document.body); $('.HeadSearching').remove(); &lt;/script&gt; &lt;script&gt; function changeHead() { alert('header replace'); $('.head').replaceWith('.HeadSearching'); } &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>if someone could help me doing this correctly .. thanks by advance ;)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload