Hi
I am relatively new to jquery so I am still getting the hang of it. So
if I am going wrong any where or my general coding practice is wrong
let me know. Any way my problem is I have wrote a treeview script for
my cms it has various features like add page, move page etc. When I
try to move a certain node using the query below the links at the top
of my page (which are nothing to do with the app) stop working, I
hover over them and the link shows in the status bar but it is as if
the onclick has a return false somewhere. But the problem only happens
when I run this code...
moveNode: function(pageid,newparent){
var theli = $('#'+TreeView.containerid+'_'+pageid).parent();
var theul = $(theli).parent();
var newli = $(theli).clone(true);
$(theli).remove();
if($(theul).find('li').length < 1){
var parentli = $(theul).parent();
$(theul).remove();
TreeView.addClasses(parentli);
} else {
$(theul).find('li').each(function(){TreeView.addClasses(this)});
}
if(newparent > 0){
var newparentli = $('#'+TreeView.containerid+'_'+newparent).parent
();
if($(newparentli).find('ul:first').length > 0){
$(newparentli).find('ul:first').each(function(){$(this).append
(newli)});
} else {
var newul = document.createElement('ul');
$(newul).append(newli);
$(newparentli).append(newul);
}
TreeView.addClasses(newparentli);
$(newparentli).find('li').each(function(){TreeView.addClasses
(this)});
} else {
$('#'+TreeView.containerid).append(newli);
$('#'+TreeView.containerid+' li:first ~ li').each(function()
{TreeView.addClasses(this)});
}
TreeView.addClasses(newli);
},
what this function does is it finds the <li> you wish to move. If the
newparent = 0 then that is the top so it just adds theli to the main
<ul>. If the newparent != 0 it will get the <li> of the newparent, if
that <li> contains <ul>'s it will just attach it to the first one. If
the newparent doesn't have any <ul>'s it will make one and append the
<li> to that.
The function works fine, in the sense that it moves the <li> without a
problem in all browsers. But it is stopping my other links from
working.
Anyway sorry to rabble on but its driving me crazy lol, if any of you
know where I am going wrong please let me know. It would be greatly
appreciated.
Regards
Mathew Chapman
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---