1
votes

I have started using interactive grid and customizing it using javascript. I have noticed that there is a character limit for the javascript code and as I get past that limit I am getting an error. As a result of that I had to simplify my code and remove all the comments. My question is how can I get around that limitation? Is there a way? Or are there any workarounds?

2
Hello, Tony provided the answer. If the code is for a specific case and, probably is not to reuse, so create a function in the same page and call it on IG javascript. If you pretend to reuse the function, so is better to create a javascript file in "shared components" and add then to your application.romeuBraga
I am having trouble adding a function. I tried adding js file to the shared components and then referencing it in the Header HTML and when that did not work, I added a script tag with the actual function in the page Header HTML. In both cases got function not defined error. Here is what I used <script src="#APP_IMAGES#Functions.js" type="text/javascript"></script>Coding Duchess
Just to test, not use a javascript file on shared components. Make your function on the page, after if it is necessary put your function in a file. In the page properties you just need to put the code of your function in the field "Function and Global Variable Declaration", you don't need to use html in this field. w3schools.com/js/js_functions.asp. If the error persist, could you post the code of your function in your answer and how do you call it in the IG javascript?romeuBraga
Actually it was my fault - made a typo in my javascript. it works now. Thank you. Could you post your comment as an answer as I created file in Shared components like you have suggestedCoding Duchess

2 Answers

2
votes

You could put most of the Javascript code in a function in a .js file and include it into the page (via the page property for Javascript file references), or even put it directly in the page Javascript Function Definitions property if that is big enough. Then call that function from the IG Javascript.

1
votes

Two options:

First

You can create a function in your page and call it in the IG javascript. Put the code of your function in the field "Function and Global Variable Declaration".

Second

You can create a javascript file and call then in your page. In this case call your javascript file in the field "File URLs". Just put the url generated after you upload the file on Shared Components.

*If this function should be used in many pages of your application, so is better to add this javascript file to your entire application instead of to each page. To do this go to "User Interface" of your application and put the url of your javascript in the field "File URLs" on "Javascript" section.