jQWidgets Forums

Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts

  • shyselsasi
    Participant

    Hi

    Like this,but I need more details like your previous code..I want to populate programatically.?I have more items and subitems in my original source.Your previous code is suit for me,but I have to add subitems too..
    Here is the source.
    Data=[{

    levelID: “1”,
    levelName: “DMRecordStore”,
    parentLevelID: “-1”,
    listData: Array[0]

    },
    {
    levelID: “2″,
    levelName: “Level1″,
    parentLevelID: “-1″,
    listData=[{
    dataID: 1
    dataName: “Association, Aggregation and Composition.pdf”
    levelID: “2”
    levelName: “Level1”
    },
    {
    dataID: 2
    dataName: “Difference between LINQ to SQL and Entity Framework.pdf”
    levelID: “2”
    levelName: “Level1”
    }]

    },

    {
    levelID: “3″,
    levelName: “Level2″,
    parentLevelID: “-1″,
    listData=[{
    dataID: 6
    dataName: “DSC00636.JPG”
    levelID: “3”
    levelName: “Level2”
    },
    {
    dataID: 7
    dataName: “DSC00636.JPG”
    levelID: “3”
    levelName: “Level2”
    }
    }]
    },
    {
    levelID: “4″,
    levelName: “ChildLevel21″,
    listData: Array[0],
    parentLevelID: “3″,
    listData: Array[0]
    },
    {
    levelID: “5″,
    levelName: “ChildLevel22″,
    parentLevelID: “3″,
    listData: Array[0]
    },
    {
    levelID: “6″,
    levelName: “ChildLevel11″,
    parentLevelID: “2″,
    listData: Array[0]
    },
    {
    levelID: “7″,
    levelName: “Level3″,
    parentLevelID: “-1″,
    listData: Array[0]
    },
    {
    levelID: “8″,
    levelName: “ChilLevel31″,
    parentLevelID: “7″,
    listData: Array[0]
    },
    {
    levelID: “9″,
    levelName: “ChildLevel311″,
    parentLevelID: “8″,
    listData: Array[0]
    }

    parentLevelID: “-1″ =>means that level have no parent level.
    ChildLevel11 is the child of Level1.
    ChildLevel21 and ChildLevel22 is the child of Level2.
    ChilLevel31 is the child level of Level3.
    ChildLevel311 is the child of ChilLevel31 .

    listData contains the files for each level.


    shyselsasi
    Participant

    And I am trying to get result like this..

    Level1
    Association, Aggregation and Composition.pdf
    Difference between LINQ to SQL and Entity Framework.pdf
    ChildLevel11
    Level2
    DSC00636.JPG
    ChildLevel21
    ChildLevel22
    Level3
    ChildLevel31
    ChildLevel311


    shyselsasi
    Participant

    Hi

    Sorry,my scenario is not like that..
    Here is the source.
    Data=[{

    levelID: “1”,
    levelName: “DMRecordStore”,
    parentLevelID: “-1”,
    listData: Array[0]

    },
    {
    levelID: “2”,
    levelName: “Level1”,
    parentLevelID: “-1”,
    listData=[{
    dataID: 1
    dataName: “Association, Aggregation and Composition.pdf”
    levelID: “2”
    levelName: “Level1”
    },
    {
    dataID: 2
    dataName: “Difference between LINQ to SQL and Entity Framework.pdf”
    levelID: “2”
    levelName: “Level1”
    }]

    },

    {
    levelID: “3”,
    levelName: “Level2”,
    parentLevelID: “-1”,
    listData=[{
    dataID: 6
    dataName: “DSC00636.JPG”
    levelID: “3”
    levelName: “Level2”
    },
    {
    dataID: 7
    dataName: “DSC00636.JPG”
    levelID: “3”
    levelName: “Level2”
    }
    }]
    },
    {
    levelID: “4”,
    levelName: “ChildLevel21”,
    listData: Array[0],
    parentLevelID: “3”,
    listData: Array[0]
    },
    {
    levelID: “5”,
    levelName: “ChildLevel22”,
    parentLevelID: “3”,
    listData: Array[0]
    },
    {
    levelID: “6”,
    levelName: “ChildLevel11”,
    parentLevelID: “2”,
    listData: Array[0]
    },
    {
    levelID: “7”,
    levelName: “Level3”,
    parentLevelID: “-1”,
    listData: Array[0]
    },
    {
    levelID: “8”,
    levelName: “ChilLevel31”,
    parentLevelID: “7”,
    listData: Array[0]
    },
    {
    levelID: “9”,
    levelName: “ChildLevel311”,
    parentLevelID: “8”,
    listData: Array[0]
    }

    parentLevelID: “-1” =>means that level have no parent level.
    ChildLevel11 is the child of Level1.
    ChildLevel21 and ChildLevel22 is the child of Level2.
    ChilLevel31 is the child level of Level3.
    ChildLevel311 is the child of ChilLevel31 .

    listData contains the files for each level.
    And I am trying to get result like this..

    Level1
    Association, Aggregation and Composition.pdf
    Difference between LINQ to SQL and Entity Framework.pdf
    ChildLevel11
    Level2
    DSC00636.JPG
    ChildLevel21
    ChildLevel22
    Level3
    ChildLevel31
    ChildLevel311

    How can I create a tree using the above source?


    shyselsasi
    Participant

    Hi

    Actually I want it programatically without any button click.My scenario is if there is a child,it will be added automatically .

    Thanks in advance.


    shyselsasi
    Participant

    Hi

    Thank you so much for your immediate reply.I have one more doubt.
    Suppose if I add this item to the above data source
    {
    levelID: “6”,
    levelName: “ChildLevel11”,
    listData: []
    }
    I want to make this item as the child of levelID: “2″,levelName: “Level1″ along with the already existing subitem..What should I do for the same?

    Thank


    shyselsasi
    Participant

    Hi Dimitar,

    Here is the data source

    Data=[{

    levelID: “1”
    levelName: “DMRecordStore”
    listData: Array[0]

    },
    {
    levelID: “2”
    levelName: “Level1”
    listData=[{
    dataID: 1
    dataName: “Association, Aggregation and Composition.pdf”
    levelID: “2”
    levelName: “Level1”
    },
    {
    dataID: 2
    dataName: “Difference between LINQ to SQL and Entity Framework.pdf”
    levelID: “2”
    levelName: “Level1”
    }]

    },

    {
    levelID: “3”
    levelName: “Level2”
    listData=[{
    dataID: 6
    dataName: “DSC00636.JPG”
    levelID: “3”
    levelName: “Level2”
    },
    {
    dataID: 7
    dataName: “DSC00636.JPG”
    levelID: “3”
    levelName: “Level2”
    }]
    }]

    Thanks


    shyselsasi
    Participant

    Hi Dimitar,
    My JSON data is array with in an array.Data and listData are the arrays.listData array is inside the data.The subitems that i want to populate is inside the listdata array.

    Thanks


    shyselsasi
    Participant

    Hi

    Is it possible to add subitem while expanding the tree node using JSON?I also want to select that node while expanding the node..While expanding i got node details,but couldn’t select that node programattically.
    I tried like this,but i am getting null values..

    $(‘#jqxbutton’).click(function () {
    $(“#jqxTree”).jqxTree(‘selectItem’, $(selectedID));
    var selectedItem = $(‘#jqxTree’).jqxTree(‘selectedItem’);
    alert(selectedItem);
    });

Viewing 8 posts - 1 through 8 (of 8 total)