Jump to content

Recommended Posts

Posted

Version: 3.0.3
URL: /admin/clients/servicetab/40/59/tabCalls/
Action: Changing from any other tabs
Problem: 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 function

My 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" });
});

 

 

Posted

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>
Posted

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?

Posted

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.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...