Anton Qcl Posted October 3, 2013 Report Posted October 3, 2013 Version: 3.0.3URL: /admin/clients/servicetab/40/59/tabCalls/Action: Changing from any other tabsProblem: When I'm changing tab inclusion of library jquery-ui doesn't occur. If I reload this page, library's inclusion occur correct.Error: Unhandled Error: '$(".custom_date").datepicker' is not a functionMy code: <div class="pad"> <ul class="highlight"> <li class="custom_date-wrapper"> <label for="id_date_start">Date Start: </label> <input type="text" name="date_start" id="id_date_start" class="custom_date" value="<?php if ($params->period == "CUSTOM") { echo $params->date_start; } ?>" > </input> </li> <li class="custom_date-wrapper"> <label for="id_date_end">Date End: </label> <input type="text" name="date_end" id="id_date_end" class="custom_date" value="<?php if ($params->period == "CUSTOM") { echo $params->date_end; } ?>" > </input> </li> </ul> </div> <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> <script> $.noConflict(); jQuery(document).ready(function($) { $(".custom_date").datepicker({ dateFormat: "yy-mm-dd" }); }); Quote
Tyson Posted October 3, 2013 Report Posted October 3, 2013 You can call blestaSetHeadTag() to set CSS/scripts, e.g.: <script type="text/javascript"> $(this).blestaSetHeadTag("link", {media:"screen", type:"text/css", rel:"stylesheet", href: "<?php echo $this->Html->safe($this->view_dir . "css/styles.css");?>"}); </script> Quote
Anton Qcl Posted October 4, 2013 Author Report Posted October 4, 2013 Thank you.It works with standart Blesta's libraries: $(this).blestaSetHeadTag( "script", { type:"text/javascript", src: "/app/views/admin/default/javascript/date.min.js" } ); $(this).blestaSetHeadTag( "script", { type:"text/javascript", src: "/app/views/admin/default/javascript/jquery.datePicker.min.js" } ); But it doesn't work with jquery.js and jquery-ui.js. I think this is occurs because another version of jquery-libraries is already included on this page. May be at first I have to exclude them? If it right, how can I do that? Quote
Tyson Posted October 4, 2013 Report Posted October 4, 2013 If there are jquery conflicts between files, then I can see a problem. There isn't a way to remove the jquery/ui scripts from the head to replace them with another. You would need to use the versions of jquery and jquery ui that already exist in the system. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.