CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Upgrade to 5.1 and jquery [RESOLVED]

Print topic Send  topic

Author Message
maxwellt

Posts: 5
Posted: 01/01/2014, 11:02 PM

I've recently upgraded to 5.1.1.18990 and the new jquery stuff seems to have confounded me.

On several of my pages am getting this error (through Firebug):

 TypeError: $(...).ccsBind is not a function

The offending code seems to be:

   $('body').ccsBind(function() {  
    features["Contentplant1GenusYahooAutocomplete1"] = $('*:ccsControl(Content, plant1, Genus)');  
   }); 

I am new to jquery and can only surmize that I am missing a .js library somewhere.
At least I am hoping that is the problem. I do not relish the idea of rebuilding a bunch of pages.

Here are all the included js files on the page:
   
<script type="text/javascript" src="../Designs/Simple/jquery.js"></script>  
<script type="text/javascript" src="../Designs/Simple/script.js"></script>  
<script language="JavaScript" src="../ClientI18N.php?file=Functions.js&locale=en" type="text/javascript" charset="utf-8"></script>  
<script language="JavaScript" src="../js/yui/build/yahoo/yahoo-min.js" type="text/javascript"></script>  
<script language="JavaScript" src="../js/yui/build/yahoo-dom-event/yahoo-dom-event.js" type="text/javascript"></script>  
<script language="JavaScript" src="../js/yui/build/datasource/datasource-min.js" type="text/javascript"></script>  
<script language="JavaScript" src="../js/yui/build/connection/connection-min.js" type="text/javascript"></script>  
<script language="JavaScript" src="../js/yui/build/animation/animation-min.js" type="text/javascript"></script>  
<script language="JavaScript" src="../js/yui/build/json/json-min.js" type="text/javascript"></script>  
<script language="JavaScript" src="../js/yui/build/autocomplete/autocomplete-min.js" type="text/javascript"></script>  
<script language="JavaScript" src="../js/yui/autocomplete-commons.js" type="text/javascript"></script>

Is this enough information to make a diagnosis?

Thanx in advance,
Max

_________________
Maxwell T. Wilson
Developer
www.ravenvision.ca
View profile  Send private message
Lucius

Posts: 220
Posted: 01/02/2014, 3:26 AM

This looks like a library conflict. Please try this and let us know of the result:

Edit the code and change

  
$('body').ccsBind(function() {    
    features["Contentplant1GenusYahooAutocomplete1"] = $('*:ccsControl(Content, plant1, Genus)');    
   });  
 

to

  
jQuery('body').ccsBind(function() {    
    features["Contentplant1GenusYahooAutocomplete1"] = jQuery('*:ccsControl(Content, plant1, Genus)');    
   });  
 
View profile  Send private message
maxwellt

Posts: 5
Posted: 01/02/2014, 11:40 AM

Alas, pretty much the same error:
 TypeError: jQuery(...).ccsBind is not a function  
 	  jQuery('body').ccsBind(function() {

Similarly, IE10 gives this message
Object doesn't support property or method 'ccsBind'

_________________
Maxwell T. Wilson
Developer
www.ravenvision.ca
View profile  Send private message
Lucius

Posts: 220
Posted: 01/02/2014, 12:48 PM

Ok, so then in fact there is something missing. What else comes to my mind is rebuilding the included js files list, maybe as you have mentioned this is a case of some file missing. It can happen sometimes with CCS...

Roll-back the change I have suggested previously.

What you can do is to delete whole block of the code (in the HTML view) that lists the include files. For example for one of my pages it looks like:

  
//Include User Scripts @1-5143DB2A  
</script>  
<script language="JavaScript" src="../js/yui/build/yahoo/yahoo-min.js" type="text/javascript"></script>  
...  
<link rel="stylesheet" type="text/css" href="../js/yui/build/autocomplete/assets/skins/sam/autocomplete.css">  
<link rel="stylesheet" type="text/css" href="favourites_style.css">  
<script language="JavaScript" type="text/javascript">  
//End Include User Scripts  

Delete the whole block (it should be marked as a lightly grey background in you CCS. Do not worry it should not mess up your page (but just in case do a backup).

Now go to Project explorer panel, on the left side, right click the page name and choose "Generate code". This should re-add the block you have just deleted to your HTML. If you can, see if any additional files were added.

Try to re-publish the page and see if this helps.

Unfortunately I can't help more, as I am using version pre-jQuery (the 5.0), but this is the second good fix that might work I can think of.
View profile  Send private message
maxwellt

Posts: 5
Posted: 01/02/2014, 11:27 PM

SUCCESS!!

The error messages went away and the functionality (dependant list boxes etc) returned.

The formating of the Autocompletes were buggered, but I eventually found the missing .css file.

That is a neat trick. It seems that CCS cleaned up and moved that long list of libraries from the .html file to the .php file. and linked to them using {page:scriptIncludes}. Seems an odd thing to do, but I guess it makes sense to someone. Is this anywhere in the documentation?

Thank-you very much. You saved me much time and agrivation. :-)
_________________
Maxwell T. Wilson
Developer
www.ravenvision.ca
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.