2016-09-21 48 views
0

我們有一個使用Telerik RadMap控件的Web應用程序。當您將鼠標懸停在某個引腳上時,RadMap控件包含一個工具提示。它動態地爲它呈現樣式,並且它們中的很多都是內聯的。我唯一需要做的就是增加Telerik Web資源生成的2個div的寬度。其中一個只有一個班,沒有ID,另一個有多個班。請記住每個引腳都有這2個div,因此它們在渲染的DOM中出現多次。 這裏的第一個div:Telerik RadMap更改動態生成的內聯樣式

<div class="k-animation-container" style="left: 714px; top: 193.12px; width: 255px; height: 234px; overflow: visible; padding-right: 4px; padding-bottom: 4px; padding-left: 4px; margin-left: -4px; display: block; position: absolute; z-index: 10002; box-sizing: content-box;"> 

而這裏的第二個(這是第一的孩子):

<div class="k-widget k-tooltip k-popup k-group k-reset RadMap RadMap_Default k-state-border-up" role="tooltip" style="display: block; position: absolute; opacity: 1;" data-role="popup"><div class="k-tooltip-content"> 

我使用CSS具有更強的選擇試過,但款式不甚至在Page Inspector中顯示爲重寫。我也嘗試使用jQuery的addClass函數和.attr('id','myCustomId');.這兩個似乎都沒有工作。

任何想法?

回答

0

您應該訪問標記工具提示窗口小部件(它是一個Kendo工具提示)並根據需要設置其屬性(例如,寬度,高度,動畫等等)。

http://www.telerik.com/forums/marker-tooltip-show-on-load#7svmjCUvskKO5Nr94p8svw是一個例子:

連接到負載事件

<ClientEvents OnLoad="map_load"/> 

遍歷標記,訪問他們的工具提示和設置屬性

function map_load(sender, args) { 
      map = sender.get_kendoWidget(); 
      //If we have items, we'll show our item tooltip 
      if (map.markers.items.length > 0) { 
       map.markers.items[0].tooltip...... //set properties    
      } 
     }