i have page uses devexpress navbar control , itemplate implemented class creates server-side running div:
public class navbarselectcriteriagroupitemtemplate implements itemplate public sub instantiatein(byval container control) implements itemplate.instantiatein dim templatecontainer navbaritemtemplatecontainer = ctype(container, navbaritemtemplatecontainer) dim div new htmlgenericcontrol("div") div.id = string.format("div_{0}", databinder.eval(templatecontainer.dataitem, "text")) div.style.add("width", "100%") div.style.add("padding", "5px") div.style.add("border", "1px solid green") div.style.add("background-color", "red") div.style.add("display", "block") div.innertext = string.format(databinder.eval(templatecontainer.dataitem, "text")) div.attributes.add("runat", "server") 'div.attributes.add("onclick", "alert('wtf!')") div.attributes.add("class", "dragme") container.controls.add(div) end sub end class
everything works fine, want add jquery-ui draggable feature each div instantiated way. tried add class attribute named dragme , add css reference on page calling itemplate no noticeable result:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script> <style type="text/css"> .dragme {} </style> <script type="text/javascript"> $('.dragme').draggable(); </script>
how can accomplish this?
thank you
you got right , put jquery in document ready block
<script type="text/javascript"> $(document).ready(function(){ $('.dragme').draggable(); }); </script>
Comments
Post a Comment