gijgo icon indicating copy to clipboard operation
gijgo copied to clipboard

How can i bind my data to tree view?

Open inasarKhan opened this issue 4 years ago • 0 comments

** $(document).ready(function(){ $('#results').change(function(){

     var id = $(this).val();
      $.ajax({
     	url: 'treeView/'+id,
     	type: 'get',
     	dataType: 'json',
     	success: function(response){

         	 var len = 0;
          if(response['data'] != null){
          	len = response['data'].length;
          }

          if(len > 0){
          
            for(var i=0; i<len; i++){
            	var id = response['data'][i].id;
            	var sdg = response['data'][i].sdg;
   
            var tree = $('#tree').tree({
                 primaryKey: 'id',
                 uiLibrary: 'bootstrap4',
                 dataSource: [ sdg ],
                 checkboxes: true
            });
           	
            }
        }
       }

       
   });
  });
});

**

inasarKhan avatar Mar 20 '21 07:03 inasarKhan