Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReloadTree from the DataBase once Updated Data into server #115

Open
smohammedyasin opened this issue May 1, 2017 · 0 comments
Open

ReloadTree from the DataBase once Updated Data into server #115

smohammedyasin opened this issue May 1, 2017 · 0 comments

Comments

@smohammedyasin
Copy link

smohammedyasin commented May 1, 2017

Hello,

i have used vm.treeConfig.version++ . and i can see in the log that tree version is increasing but tree not reloading.

app.controller('treeCtrl')// Controller For Tree
{
         var vm = this;
        vm.ignoreChanges = false;
        vm.treeData = [];//



        $scope.getTreeData = function () {
            var getData = channelServices.getTree();
            getData.then(function (chn) {
                //console.log(chn.data);
                for (var i = 0; i < chn.data.length; i++) {
                    vm.treeData.push({
                        id: chn.data[i].id, parent: chn.data[i].parent, text: chn.data[i].text,
                        type: chn.data[i].type, state: { checkbox_disabled: chn.data[i].checkboxdisabled, opened: 
                         chn.data[i].opened, disabled: chn.data[i].disabled }, image: 'yasin'
                    })
               }
              scope. reloadTree();
            }, function (chn) {
                toastr.error(chn.data, 'Oh My!');
            });
        };


       vm.treeConfig ={......}//config for tree

    $scope.reloadTree = function () {//reload tree
            vm.treeConfig.version++;
            console.log(vm.treeConfig.version);
        };
}

app.cotroller('modelCtrl')//model popup controller
{
      $scope.UpdateNode=function(){
    //update into server using http$
             $scope.$parent..reloadTree();
       };
}

each time when i call function "UpdateNode" from modal popup can see tree version is increasing but tree not recreating with updated data from the server

@smohammedyasin smohammedyasin changed the title how to ReloadTree from another controller ReloadTree from the DataBase once Updated Data into server May 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant