This looks perfect and what I am expecting is to do it with server-side using
C#SQL Server. Anyone worked with it earlier or any code samples are there that I can use on my end? Would expect some quick suggestions on this and much appreciated - Thanks.
Helping others is to provide help to yourself. Mark as answer, if the solution helps.
Or depending on your data, a first step could be to render "theTree" from server side data rather than having this hardcoded in your HTML page. BTW you are using MVC or Web Forms?
It's always best to be explicit about the very first problem you have when trying to do something so that we can better understand which kind of help you need (it's a bit harder when having no idea at all about your current skill level).
Hello @PatriceSc! I prefer to use ASP.NET MVC and worked with
jSon earlier but not in depth. Could you provide a sample same as the
JsFiddle now if possible?
Helping others is to provide help to yourself. Mark as answer, if the solution helps.
Your question is too vague to answer and seems to encompass the entire .NET stack. What exact;y do you need help with? Can you at least provide the code you have tried, explain the expected results, and explain the actual results.
Hello @mgebhard! Thanks for the reply and unfortunately I didn't try anything yet but would be trying to do it myself. My requirement is to show category details in a TreeView, finally
can drag and drop product details to it. In the example, there is a TreeView and a
Table or Div. See the below again:
So when I drag a product to the Table or Div from the TreeView, then it should be visible to the
Table or Div section only. But not to the
TreeView, please see the sample again. Finally the vice-versa could be done. I was just trying to do it in the database-level and believe, this should require few Ajax call to make the changes. Whenever I change a product to a different category, this
would be changed in the database as well.
Helping others is to provide help to yourself. Mark as answer, if the solution helps.
Participant
1779 Points
852 Posts
JsTree With Data From Database
Apr 29, 2019 05:21 AM|TechView|LINK
Hello friends! I am trying to learn JsTree and found a solution that I require. Here is the link that I am checking now:
JsTree Sample
This looks perfect and what I am expecting is to do it with server-side using C# SQL Server. Anyone worked with it earlier or any code samples are there that I can use on my end? Would expect some quick suggestions on this and much appreciated - Thanks.
TechView
All-Star
48570 Points
18081 Posts
Re: JsTree With Data From Database
Apr 29, 2019 10:01 AM|PatriceSc|LINK
Hi,
Have you tried https://www.jstree.com/docs/json/which shows which kind of json data returned by your server could be used to populate the tree. Try maybe https://www.c-sharpcorner.com/article/working-with-json-in-mvc/ if you need to see how json with MVC works.
Or depending on your data, a first step could be to render "theTree" from server side data rather than having this hardcoded in your HTML page. BTW you are using MVC or Web Forms?
It's always best to be explicit about the very first problem you have when trying to do something so that we can better understand which kind of help you need (it's a bit harder when having no idea at all about your current skill level).
Participant
1779 Points
852 Posts
Re: JsTree With Data From Database
Apr 29, 2019 10:38 AM|TechView|LINK
Hello @PatriceSc! I prefer to use ASP.NET MVC and worked with jSon earlier but not in depth. Could you provide a sample same as the JsFiddle now if possible?
TechView
All-Star
53081 Points
23652 Posts
Re: JsTree With Data From Database
Apr 29, 2019 11:06 AM|mgebhard|LINK
Your question is too vague to answer and seems to encompass the entire .NET stack. What exact;y do you need help with? Can you at least provide the code you have tried, explain the expected results, and explain the actual results.
Participant
1779 Points
852 Posts
Re: JsTree With Data From Database
May 02, 2019 05:21 AM|TechView|LINK
Hello @mgebhard! Thanks for the reply and unfortunately I didn't try anything yet but would be trying to do it myself. My requirement is to show category details in a TreeView, finally can drag and drop product details to it. In the example, there is a TreeView and a Table or Div. See the below again:
Sample JsTree
So when I drag a product to the Table or Div from the TreeView, then it should be visible to the Table or Div section only. But not to the TreeView, please see the sample again. Finally the vice-versa could be done. I was just trying to do it in the database-level and believe, this should require few Ajax call to make the changes. Whenever I change a product to a different category, this would be changed in the database as well.
TechView