xiaochong / zkui

Grails ZK UI Plugin
http://grails.org/plugin/zkui
GNU Lesser General Public License v3.0
24 stars 8 forks source link

JQuery inside a ZK component #110

Closed Globiboulga closed 11 years ago

Globiboulga commented 11 years ago

Hi !

I'm trying to integrate the Jquery File Tree from http://www.abeautifulsite.net/blog/2008/03/jquery-file-tree/ into my ZK UI project, and i've got some problem.

I use the following script in my head: $(function() { $('#file-tree').fileTree({ root:'/', script: "${createLink(controller:'media',action: 'generateFileList')}" }, function(file) { alert(file) }); })

When i put my element inside the ZK window component with the div tag, seems like the jquery function() is never called and nothing happend

But outside a ZK component, there is no problem the jquery file tree is display.

I tried the zk way for jquery ,replacing my script with : zk.afterMount(function() { jq('#file-tree').fileTree({ root:'/', script: "${createLink(controller:'media',action: 'generateFileList')}" }, function(file) { alert(file) }); })
But this is still not working. Am i missing something ? Is there a "special way to integrate some Jquery " ?

I am using: grails 2.1.1 zkui 0.5.4 jquery(the grails plugin)1.8.0

Thanks !