2016-03-19 43 views
4

我在angular-ui-grid上顯示標題tooltip時出現問題。
這是plunker demoAngular UI網格工具提示不起作用

任何想法如何使它工作?

+0

API說headerTooltip是一個布爾值,但他們的例子說這是你想要顯示的字符串。 http://ui-grid.info/docs/#/api/ui.grid.class:GridOptions.columnDef vs http://ui-grid.info/docs/#/tutorial/117_tooltips - 所以是的,好問題! –

+0

我現在可以使用下面的解決方案修補它,希望它現在可以幫到你。 –

+0

我修復了Plunker鏈接對此感到抱歉。 –

回答

0

我一直無法弄清楚如何通過將headerTooltips設置爲字符串來使指令正常工作。指令開發人員正在使用與您在此Plunker中可以看到的不同實現。

該解決方案將修補問題,直至找到更好或更永久的問題。將它置於控制器內部的服務呼叫的末尾,如下所示。

upareneStavkePromise.then(function(upareneStavkeData){ 
      $log.debug(upareneStavkeData); 
      $scope.ucitaniUpareniPodaci = true; 
      $scope.gridOptionsUpareniPodaci.data = upareneStavkeData.grupe; 
      upareneStavkeTotals = upareneStavkeData.totals; 


      /* 
       * Patch for possible bug: 
       * Description: Setting headerTooltip property 
       * value as a string doesn't render the value at 
       * runtime. 
       * 
       */ 

      //class for the header span element 
      var headerClass = ".ui-grid-header-cell-primary-focus"; 

      //the column definitions that were set by the developer 
      var colDefs = $scope.gridOptionsUpareniPodaci.columnDefs; 

      //Get the NodeList of the headerClass elements. 
      //It will be an array like structure. 
      var headers = document.querySelectorAll(headerClass);  

       //loop through the headers 
       angular.forEach(headers,function(value,key){//begin forEach 

        //Set the title atribute of the headerClass element to 
        //the value of the headerTooltip property set in the columnDefs 
        //array of objects. 
        headers[key].title = colDefs[key].headerTooltip;      


       });//end forEach 


      /****************END PATCH********************/   


     }); 
+0

我會檢查它。與此同時,你的鏈接鏈接是空的。 – gandra404

+0

我會修復,當我有機會謝謝你 –