Hareeshchandera / jsplumb

Automatically exported from code.google.com/p/jsplumb
0 stars 0 forks source link

jsPlumb plus mySQL #151

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi Simon, I have a question regarding the ability of jsPlumb to retrieve a 
record/data (ex. some flowchat/workflow steps) from a database like mySQL, 
PostgreSQL, ORACLE, etc. After getting the record, it will display jsPlumb 
accordingly with the said record from your database. Same also goes for saving 
your jsPlumb connections in your database. I hope you understand my question 
and hoping for your quick reply and explanation. P.S I'm using PHP by the way. 
Thanks. 

Original issue reported on code.google.com by mohammad...@gmail.com on 24 Nov 2011 at 8:33

GoogleCodeExporter commented 8 years ago
hello,

jsPlumb is a view technology only - it doesn't do anything except connect stuff 
together with lines.  you have to write the code to retrieve, render and save 
records yourself.

Original comment by simon.po...@gmail.com on 24 Nov 2011 at 8:52

GoogleCodeExporter commented 8 years ago
Thanks for replying Simon. However, I think it would be better if there is/are 
an existing example/s here or in the jsPlumb website regarding on how to 
interact with a database. Sir if I may, I would also like to note that the site 
kind of lacks an easy step by step tutorial on how to create a jsPlumb 
connections. I know that there are demos, documents, API and samples provided 
but an easy step by step tutorial on how to create would be helpful to newbies 
like me. Thank you very much Simon.

Original comment by mohammad...@gmail.com on 24 Nov 2011 at 10:23

GoogleCodeExporter commented 8 years ago

Original comment by simon.po...@gmail.com on 24 Nov 2011 at 8:12

GoogleCodeExporter commented 8 years ago
the thing is that jsPlumb and databases have got nothing to do with each other. 
 it's just a view technology.  it doesn't care about where the data came from, 
and the data will come from somewhere different in every application that uses 
jsPlumb.  so the bounds of my responsibility as far as demos are concerned is 
to provide you with examples of making jsPlumb connect stuff together.

i think there is a decent explanaton of how to make simple connections.  in the 
docs, where it talks about connecting things, it starts off "the simplest 
connection you can make in jsPlumb is...".  what you're asking for is a 
tutorial on how to build fat client.  there are plenty of those on the internet!

Original comment by simon.po...@gmail.com on 24 Nov 2011 at 10:21

GoogleCodeExporter commented 8 years ago
OK sir, I understood. I'm sorry for acting like a spoiled brat. I apologize. I 
guess, I'm just frustrated because I'm still an amateur when it comes to 
jquery, ajax and of course jsplumb. I need more research. =D By the way sir, I 
implemented jsplumb in one of my sites and I'm having problems with it. It's 
issue no. 152. I hope you can address this.

Thank you very much...  

Original comment by mohammad...@gmail.com on 25 Nov 2011 at 7:42

GoogleCodeExporter commented 8 years ago
oh i dont think you're sound like a spoiled brat - you sound like a guy who is 
new to some of these technologies and needs a starting point...

for the system you described i think you just need to sit down and split it up 
into its logical parts.  so you've got a bunch of records in a database and you 
want to load, display, edit and save them, right?  i'd recommend that you avoid 
ever putting record data into an HTML page.  instead, serve the HTML as one PHP 
page, and have a separate endpoint, serving JSON, for fetching and saving 
records (i'm sure there are plenty of JSON libraries for HP).  then have a JS 
file that contains the functions required to load/save a record.  because 
you're talking JSON you have very little work to do in the client other than 
the http communications.  lastly you need a JS file that creates the UI from 
the models that the other JS gives you.  it's good to keep that separate 
because a) it's good, ha, and b) JS can get a bit unruly when files get large.  
you may, of course, wish to concat them and compress them when your system goes 
into production if you're expecting a heavy load.

that's the sort of basic architecture i'd be looking at if i were you.  do you 
see how jsPlumb only appears right at the very end of that whole thing?  
everything else is different for everyone's particular app.  

i'll take a look at that other issue you raised.  

Original comment by simon.po...@gmail.com on 25 Nov 2011 at 8:12

GoogleCodeExporter commented 8 years ago
Sir, thank you very much for your guideline and I understand where jsPlumb 
stand. I also thank you for understanding my situation. Sir, actually adding 
steps (along with its label) and its substeps (along with its label) for my 
workflow diagram will be through a textbox and a save button. But the hard part 
is when I retrieve those data and translate it to a jsPlumb view. From your 
explanation, I can see what tools to use and how data are going to be passed. 
But I can't imagine when I retrieve those data and pass it into the jsPlumb 
javascript and then position or connect the elements, endpoints, connectors 
according to the record fetched. That's what bugging me right now sir. Hehehe..

Thank you very much..

Original comment by mohammad...@gmail.com on 25 Nov 2011 at 9:01

GoogleCodeExporter commented 8 years ago
Thank you also for taking a look at issue 152. =D

Original comment by mohammad...@gmail.com on 25 Nov 2011 at 9:02