populating Jstree from a PL/SQL procedure

180 views
Skip to first unread message

Othello

unread,
Dec 13, 2009, 4:45:29 AM12/13/09
to jsTree
Hi Ivan

great job with the JStree...impressive...I have been twidling with it
for a while. now I want to try and integrate it with my Oracle APEX
application. I want to build the tree based on Json that is generated
on the fly by a PL/SQL procedure (that I can call via URL).

The produced Json code is:

[ { data: "Company:NECS, LDA" ,
children : [ { data : "Car2" ,
children : [ {data:"358244017666654" ,
title:"358244017666654 ",href:"p=APP_ID:
9:SESSION_ID::::P9_COMPANY,P9_VEHICLE,P9_SELECTOR,P9_USERID,P9_SHOW_ALL:
61,358244017666654,SELECTOR,USERID,N",
title: ]} ,
{ data : "Truck" , children : [ ]} ,
{ data : "Van" , children : [

{data:"358244016773352" , title:"358244016773352
",href:"p=APP_ID:
9:SESSION_ID::::P9_COMPANY,P9_VEHICLE,P9_SELECTOR,P9_USERID,P9_SHOW_ALL:
61,358244016773352,SELECTOR,USERID,N", title: ,
{data:"353234021217920" , title:"353234021217920 ",href:"p=APP_ID:
9:SESSION_ID::::P9_COMPANY,P9_VEHICLE,P9_SELECTOR,P9_USERID,P9_SHOW_ALL:
61,353234021217920,SELECTOR,USERID,N", title: ]} , { data :
"Motorcycle" , children : [ {data:"358244017666878" ,
title:"358244017666878 ",href:"p=APP_ID:
9:SESSION_ID::::P9_COMPANY,P9_VEHICLE,P9_SELECTOR,P9_USERID,P9_SHOW_ALL:
61,358244017666878,SELECTOR,USERID,N", title: ]} ]

and the URL I need to set is of the format:

http://127.0.0.1:8082/apex/getJsonvehicle?pcomp=61

where pcomp is a parameter I am passing.

The HTM code for this is:

<script type="text/javascript" class="source">
$(function () {
var pcom = 61;
$("#async_json_1").tree({
data : {
async : true,
opts : {
type : "json",
url : "/getJsonvehicle?pcomp=61",
method: "GET"
}
} });
});


yet in firebug I get an error saying that the procedure call is wrong
as if it is not reading the parameter...

any help would be greatly appreciated.

vakata

unread,
Dec 13, 2009, 11:49:49 AM12/13/09
to jsTree
Hi,

I guess your page is also on port 8082? Otherwise you will not be able
to retrieve the data straightforward.

As for the issue - the "type" setting must be on the same level as
async.
If that does not help - what does firebug say about the get/post
parameters? It would also be nice if you can provide a working demo -
that way I will be able to help you debug.

Regards,
Ivan

George Salloum

unread,
Dec 13, 2009, 1:27:18 PM12/13/09
to jst...@googlegroups.com
Hi Ivan


thanks for the reply...I finally managed to get it up and running using the HTML data instead...in APEX im using PL/SQL to generate the data and i use the jstree to format it...its simply WONDERFUL !!! I have been struggling with every kind of JavaScript tree you can immagine :) none gave me this functionality

I will keep you udated and as soon as I put it up on a live site I will inform you.

thanks

--

You received this message because you are subscribed to the Google Groups "jsTree" group.
To post to this group, send email to jst...@googlegroups.com.
To unsubscribe from this group, send email to jstree+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jstree?hl=en.





--
George E. Salloum
Senior ICT Consultant

George Salloum

unread,
Dec 14, 2009, 1:48:06 PM12/14/09
to jst...@googlegroups.com
Hi again Ivan

Sorry for the trouble but I am in a bit of a spot here...

I am using Jquery tabs along with your jstree...thing is whenever I include the jquery libraries, jstree breaks and if I do not include those libraries, my tabs will not work.

here's how i include the jquery files...

<link rel="stylesheet" href="/i/jquery/css/smoothness/jquery-ui-1.7.2.custom.css" type="text/css" />

<script src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
   google.load('jquery', '1.3.2');
   google.load('jqueryui', '1.7.2');
</script>



any help would be greatly appreciated.


thanks

vakata

unread,
Dec 16, 2009, 10:59:18 AM12/16/09
to jsTree
Hmm,

Can you provide a working demo or some Firebug output?

Kindest regards,
Ivan

On 14 Дек, 20:48, George Salloum <yorgo...@gmail.com> wrote:
> Hi again Ivan
>
> Sorry for the trouble but I am in a bit of a spot here...
>
> I am using Jquery tabs along with your jstree...thing is whenever I include
> the jquery libraries, jstree breaks and if I do not include those libraries,
> my tabs will not work.
>
> here's how i include the jquery files...
> *
> <link rel="stylesheet"
> href="/i/jquery/css/smoothness/jquery-ui-1.7.2.custom.css" type="text/css"
> />
>
> <script src="http://www.google.com/jsapi"></script>
> <script type="text/javascript">
>    google.load('jquery', '1.3.2');
>    google.load('jqueryui', '1.7.2');
> </script>*
>
> any help would be greatly appreciated.
>
> thanks
>
>
>
> On Sun, Dec 13, 2009 at 8:27 PM, George Salloum <yorgo...@gmail.com> wrote:
> > Hi Ivan
>
> > thanks for the reply...I finally managed to get it up and running using the
> > HTML data instead...in APEX im using PL/SQL to generate the data and i use
> > the jstree to format it...its simply WONDERFUL !!! I have been struggling
> > with every kind of JavaScript tree you can immagine :) none gave me this
> > functionality
>
> > I will keep you udated and as soon as I put it up on a live site I will
> > inform you.
>
> > thanks
>
> >> jstree+un...@googlegroups.com<jstree%2Bunsu...@googlegroups.com>
> >> .
Reply all
Reply to author
Forward
0 new messages