2014-11-17 2 views
2

SQL 데이터베이스의 일부 데이터를 관리하기 위해 umbraco에 사용자 지정 섹션을 만들었습니다.Umbraco 7 : 내 사용자 정의 섹션에서 트리보기를 새로 고칠 수 있습니까?

항목을 편집 할 수 있지만 추가 할 때 페이지를 새로 고침하여 왼쪽의 사용자 정의 트리에서 새 행을 확인해야합니다.

어떻게 AngularJS를 사용하여 내 사용자 정의 트리를 새로 고칠 수 있습니까? 내 나무를 "고객"이라고합니다.

코드를 디버깅 해보고 이벤트를 찾기 위해 소스를 조사했지만 어떻게 처리 할 수없는 것처럼 보입니다.

어쨌든 umbTreeDirective에서 전화 할 수있는 방법이 있습니까? 아니면 구독 할 이벤트입니까?

저는 AngularJS에 새로 입문했으며 약간 어려움을 겪고 있습니다.

답변

3

당신은 navigationService을 찾고 있습니다.

navigationService.syncTree({ tree: 'clients', path: content.path, forceReload: false, activate: true });

가 여기 인위적인, 스파게티 약속하지만 전체 예제 :

이 줄은 syncTree 호출의 예입니다

angular.module("umbraco") 
.directive('nowplaying', ['navigationService', 'contentResource', 'contentEditingHelper', function (navigationService, contentResource, contentEditingHelper) { 

       //spaghetti example to create new document 
       contentResource.getScaffold(parentId, alias) 
       .then(function (scaffold) { 
        var myDoc = scaffold; 
        myDoc.name = name; 

        //we have minimum to publish 
        contentResource.publish(myDoc, true, ['']) 
         .then(function (content) { 
          $scope.newlyCreatedNode = content; 

           //Sync ('refresh') the tree! 
           navigationService.syncTree({ tree: 'clients', path: content.path, forceReload: false, activate: true }); 

        }); 
       }); 
}]); 

Belle documentation lives here의 모든. - 적극적으로 유지 관리되고 있는지 확신 할 수는 없지만 처음 게시 된 이래로 하나 또는 두 개의 서명이 변경되었다고 말할 수 있습니다. 그건 제쳐두고, 내가 umbraco 노출 모듈 및 서비스와 상호 작용하는 것을 알고있는 최고의 리소스입니다.