2016-03-19 31 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

我会修复,当我有机会谢谢你 –