Skip to Content
avatar image
Former Member

Use third party library (jsTree)

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Nov 02, 2015 at 03:12 AM

    Hi Alex

    What is arbol?

    Thanks

    -D

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 02, 2015 at 06:34 AM

    Hi Alex,


    jsTree requires 1.9.0 or greater in your webpage.


    Thanks,

    KA

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 02, 2015 at 06:37 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 02, 2015 at 06:45 AM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 02, 2015 at 10:58 AM

    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(); });

    Add comment
    10|10000 characters needed characters exceeded