jQWidgets Forums

Forum Replies Created

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • in reply to: dragEnd event mistake dragEnd event mistake #10773

    marchip
    Member
    <script type="text/javascript">
    var theme = 'classic';
    $(document).ready(function () {
    var onTreeField = false;
    loadFields();
    loadCustom();
    loadFunctions();
    $("#jqxTreeEvent").bind('dragEnd', function (event, source) {
    if (event.args.originalEvent != undefined) {
    //************problem is here************
    //this event parameter refer jqxTreeFunction instead #jqxTreeEvent
    //my code....
    }
    });
    });
    function loadFields() {
    var xmlEvent = getXmlEvent();
    var treeSource =
    {
    localdata: xmlEvent,
    datatype: 'json'
    };
    var dataAdapter = new $.jqx.dataAdapter(treeSource);
    dataAdapter.dataBind();
    var records = dataAdapter.getRecordsHierarchy('id', 'parentId', 'items', [{ name: 'text', map: 'label' }, { name: 'tag', map: 'value'}]);
    $('#jqxTreeEvent').jqxTree({ source: records, width: '300px', theme: 'classic', allowDrag: true, allowDrop: false });
    }
    function loadCustom() {
    $('#jqxTreeField').jqxTree({ height: '250px', width: '200px', theme: theme, allowDrop: true });
    }
    function loadFunctions() {
    $.ajax({
    url: "/Event/GetFunctions",
    type: "GET",
    beforeSend: function () {
    },
    error: function (json, textStatus, errorThrown) {
    },
    success: function (data2) {
    var treeSource2 =
    {
    localdata: data2,
    datatype: 'json'
    };
    var dataAdapter2 = new $.jqx.dataAdapter(treeSource2);
    dataAdapter2.dataBind();
    var records2 = dataAdapter2.getRecordsHierarchy('id', 'parentId', 'items', [{ name: 'signature', map: 'label' }, { name: 'type', map: 'value'}]);
    $('#jqxTreeFunction').jqxTree({ source: records2, width: '200px', height: '250px', theme: 'classic', allowDrop: false });
    $('#jqxTreeFunction').jqxTree('expandAll');
    }
    });
    }
    </script>
    <div id='jqxWidget'>
    <div style='float: left;'>
    <div id='jqxTreeEvent' style='float: left; margin-left: 0px;'>
    </div>
    <div style='float: left; margin-left: 20px;' id="jqxTreeField">
    </div>
    </div><br /><br /><br />
    <div style='margin-left: 20px;' id="jqxTreeFunction">
    </div>
    </div>
    in reply to: Xml Binding Xml Binding #10714

    marchip
    Member

    I’ve already seen the demo but not function.
    Code:

    var treeSource =
    {
    localdata: data,
    datatype: 'xml',
    datafields: [
    { name: 'Signature', map: 'simpleSignature' },
    { name: 'Category', map: 'category' }
    ],
    root: "function",
    record:"function",
    id: 'simpleSignature'
    };
    var dataAdapter = new $.jqx.dataAdapter(treeSource);
    dataAdapter.dataBind();
     var records = dataAdapter.getGroupedRecords(['Category'], 'items', 'label',[{ name: 'Signature', map: 'label'}]);
    $('#tree').jqxTree({ source: records, height: '300px', width: '300px', theme: theme });

    The result is this:

    image

    in reply to: Bind Generic XML to JqxTree Bind Generic XML to JqxTree #9937

    marchip
    Member

    Ok thank you.
    Another question…
    how can I retrieve the path of an item of which I’m doing drag & drop?

    Example
    I have this structure:

    <prova2>	
    <campo1>c1</campo1>
    <campo2>c1</campo2>
    <campo3>
    <campo4>c4</campo4>
    </campo3>
    </prova2>

    if I drop “campo4” i would to know the path prova2/campo3/campo4…

    It’s possible?

    Thanks

    in reply to: Bind Generic XML to JqxTree Bind Generic XML to JqxTree #9931

    marchip
    Member

    I’ve seen this example. The example assumes that I know the structure of the XML. But I do not know the structure of the XML that I want to represent.So you can pass a generic xml and render it?

    Thanks

Viewing 4 posts - 16 through 19 (of 19 total)