gpt4 book ai didi

angularjs - Angular ui 网格工具提示不起作用

转载 作者:行者123 更新时间:2023-12-01 06:08:07 24 4
gpt4 key购买 nike

我在显示标题时遇到问题 tooltipangular-ui-grid .
这是plunker demo .

知道如何使它工作吗?

最佳答案

我一直无法弄清楚如何通过将 headerTooltips 设置为字符串来使指令在内部正常工作。指令开发人员正在使用与您不同的实现来使其工作,这可以在此 Plunker 中看到。 .

此解决方案将修补问题,直到找到更好或更持久的解决方案。将它放在 Controller 内部的服务调用末尾,如下所示。

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 - Angular ui 网格工具提示不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36107878/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com