How to add a javascript function in the Code

22 views
Skip to first unread message

Kumaravel Sadras

unread,
Apr 5, 2013, 2:29:50 PM4/5/13
to li...@googlegroups.com
In the code view I want to call a new javascript function that I wrote from the onRenderer event

something like

function sortByLeft(a,b)
   {
      a = a.left;
      b = b.left;
      return ((a < b) ? -1 : ((a > b) ? 1 : 0));    
   }

How do I do that?

Thanks,
-Kumar.
Message has been deleted

Kumaravel Sadras

unread,
Apr 5, 2013, 5:25:09 PM4/5/13
to li...@googlegroups.com
I fixed this by writing code inline.
 
But it would be nice to know if there is a way to add more js functions, without modifying the original build, right in the Code View.

Thanks,
-Kumar.

Jack Lee

unread,
Apr 6, 2013, 11:40:23 PM4/6/13
to li...@googlegroups.com
You can write your js code in other file, include it in the html, and you can use it's global name to call it.
Reply all
Reply to author
Forward
0 new messages