cancel
Showing results for 
Search instead for 
Did you mean: 

Use third party library (jsTree)

Former Member
0 Kudos

Hello experts,

I am trying to use the opensource component jsTree because the "tree" provided by SAP doesn't gives the option to show the lines to clearly diferentiate nodes but I can't which is weird as it seems pretty simple from my pov.

I've downloaded the required files and added this line in the index.html:

<script type="text/javascript" src="res/jsTree/jstree.min.js"></script>

I've used this to include other own javascript files and worked perfectly, but when I try to call the function $('#arbol').jstree() from a view, I get an error that says:

Uncaught TypeError: $(...).jstree is not a function

I really don't know whats happening because the library is correctly loaded as I checked that on the network tab of the chrome dev tools. I'm afraid this will happen with every single third party library i try to use...

Thanks in advance,

Alex.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

The funny part of all this is that if I add the following line as watch expression in the chrome dev tools, I get no error:

$(function () { $('#arbol').jstree(); });

karthikarjun
Active Contributor
0 Kudos
Former Member
0 Kudos

Hi Alex

You should call the API from the controller in the "after rendering" event.

Take under consideration there is a lot of third party components that been disabled by the other UI5 components.

In this example

i was trying to use Gridster  (3rd party ) and the VIZ charts disables this component.

For now i'm trying to think a work around with other components ..

Regards,

Arie.

Former Member
0 Kudos

I have tried to call the API in the "after rendering" event but no effect. Thanks.

karthikarjun
Active Contributor
0 Kudos

Hi Alex,


jsTree requires 1.9.0 or greater in your webpage.


Thanks,

KA

Former Member
0 Kudos

Yes, I know. I'm running 1.11.1.

former_member182862
Active Contributor
0 Kudos

Hi Alex

What is arbol?

Thanks

-D

Former Member
0 Kudos

Is just the ID of the div that refers to the tree.