jQWidgets Forums

Forum Replies Created

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

  • JonH
    Participant

    I proposed the drag/drop and they didn’t like that solution.

    I was able to make it work by saving the items unique ID in a hidden “selected_item_id” field, and then:

       function update_item_tree() {
          var item_tree_dataAdapter = new $.jqx.dataAdapter(item_tree_source);
          item_tree_dataAdapter.dataBind();
          var item_tree_records = item_tree_dataAdapter.getRecordsHierarchy('id', 'parentid', 'items', [{name:'text', map: 'label'}]);
          $('#item_tree').jqxTree({ source: item_tree_records, height: '540px', width: '200px'});
          $('#item_tree').jqxTree('expandItem',$("#"+$('#selected_item_id').val())[0]);
          $('#item_tree').jqxTree('selectItem',$("#"+$('#selected_item_id').val())[0]);
       };
    

    I can use this function when they update the year and when they update the item name (used as the label).

    -jon


    JonH
    Participant

    I had a flash of inspiration and found a way to make it work. Well, at least it works in my limited testing so far. 🙂

    I moved my datasource definitions out of the initnotedetails and initauditdetails functions so they are available outside of them. Then I added notesource.url = “load_notes.php?=”+record.adm_num, and a similar line for the auditsource, to the initrowdetails function.

    If there’s a better way, I’m open to learn.

    Thanks.

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