Closed jloguercio closed 9 years ago
$(document).ready(function() {
$(window).load(function() {
$.ajax({
data: 'action=obtenerMenu',
url: '../controladores/CtrlSession.php',
type: 'POST',
success: function(response) {
$('#Menu').html(response);
$.AdminLTE.tree();
}
})
});
That should fix your issue.
The only other way to do it is to lest your ajax return the link titles only without the html and let jQuery create the elements for you. But it is a lot more work than one line of code.
Hi and thanks for the reply
$.AdminLTE.tree(); this cant solve my issue, in the console shows :
Uncaught TypeError: Cannot read property 'tree' of undefined
Did you place your code after loading the app.js file?
Yes i do but i found the correct solution using this : $(".treeview").tree(); i found it in app.js trying to modify some code there ... but it works fine ! Thank you very much
Oh I am sorry. It was supposed to be $.AdminLTE.tree('.sidebar')
. I am not sure why your way works though. You should test it on all browsers that you'd like to support. Thanks!
Hi, my english is so bad, but well, when i try create it with jquery using ajax to set a post to a php file where i create a variable where i mark up the entire html code for the menu like this :
in my menu i got this
this is my .js
And this is my php file
this works fine it create the menu and its ok, but when i click the menu the dropdown doesnt work!
but if i directly paste the entire html menu code it works and its the same html code that i copy and paste to the variable
how can i fix it?