angularjs – Angular ui grid工具提示不起作用

前端之家收集整理的这篇文章主要介绍了angularjs – Angular ui grid工具提示不起作用前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有问题在angular-ui-grid上显示标题工具提示.
这是 plunker demo.

知道如何让它工作吗?

解决方法

通过将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********************/          


        });

猜你在找的Angularjs相关文章