Skip to content

daredevel tree in bootstrap modal #41

Open
@biscit

Description

@biscit

Hi,
I have implemented the daredevel tree in my application, and I ran into an issue.
For my application, I have dropdown in a bootstrap modal. On selection of an option from that dropdown, an ajax request is triggered. This ajax request fetches an unordered list form the server, is loaded in the bootstrap modal, under de selection list. Everything works just fine.
But Suppose I have chosen a wrong option, and I select a second one, the ajax request is fired,

    is fetched and the old
      is replaced by the new one.
      But now, the tree is not collapsed, and the little arrows in front of the checkboxes, are not there.

      This is the code that I use for my ajax request :

      $('#shopkeuze').change(function() {

          var shopid = '';
          shopid = $('#shopkeuze').val();
      
          $.ajax({
              url: "product/laadWebgroepen",
              method: "post",
              data: {
                  "id": shopid
              },
              beforeSend: function(request) {
                  return request.setRequestHeader('X-CSRF-Token', $("input[name=_token]").val());
              },
              success: function(data) {
      
                  $('#cat_tree2').html(data);
      
                  $('#cat_tree2').tree({
                      dnd: false,
                      expandEffect: null,
                      collapseEffect: null,
                      onCheck: { ancestors: 'uncheck', descendants: 'check' }, onUncheck: { ancestors: 'uncheck' }
                  });
              },
              error: function(thrownError) {
                  console.log(thrownError);
              }
          });
      });
      

      can you give me a tip what is going on ? Many thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions