2012-01-26 6 views
3

私はdojoのContentPaneを使用して、オープンレイヤー・マップをレンダリングしています。 DOMが準備完了し、マップが挿入されると、dijitのsytleが上書きされます。私はclassとidでCSSの高さと幅を指定してみました。また、HTMLでインライン展開しました。Dojoのデータ・ドウホー小道具のスタイルが上書きされました

私のhtml:

<div id="map-id" 
class="centerPanel" 
    data-dojo-type="dijit.layout.ContentPane" 
    data-dojo-props="region: 'center', style: 'width: 1468px;'"> 
</div> 

私のCSS:

#map-id { 
width: 1468px; 
height: 471px; 
} 
.centerPanel { 
width: 1468px; 
height: 471px; 
} 

放火犯からの私の実際のhtml:

<div id="map-id" class="centerPanel dijitContentPane dijitBorderContainer-child dijitBorderContainer-dijitContentPane dijitBorderContainerPane dijitAlignCenter olMap" data-dojo-props="region: 'center', style: 'width: 1468px;'" data-dojo-type="dijit.layout.ContentPane" title="" role="group" dir="ltr" style="width: 1455px; left: 252px; top: 48px; right: auto; bottom: auto; height: 456px;" widgetid="map-id"> 

あなたは私のデータ・道場・小道具のスタイリングがignordedされ見ることができるように新しい高さと幅が挿入されます...任意のアイデア?

+0

あなたのContentPaneがBorderContainer内にあるように聞こえます。この場合、親レイアウトウィジェット(BorderContainer)が子ContentPaneのサイズを決定する可能性が高くなります。おそらく、あなたがしたいことのより完全な例を提供することは、私たちがより協力して助けてくれるだろう。 –

答えて

0

あなたは、もしあれば、あなたのコンテナにdoLayout:falseを追加する必要があるかもしれません:)

0

のBorderContainerの中心領域は、利用可能な任意の残りのスペースを埋めるような大きされます。中央領域を特定のサイズにしたい場合は、中央領域を占めるウィジェットではなくBorderContainerをスタイルする必要があります。

1

私はdojoグリッドでこれを試してみましたが、これも機能しません。私はあなたがjavascriptコードでそれをやってみることをお勧めします。

widthとheight属性を持つスタイルオブジェクトをコンテナオブジェクトに追加します。

myGrid = new DataGrid({ 
    store: myObjectStore, 
    structure : myStructure, 
    style: { 
     width: '1000px', 
     height: '500px', 
    }, 
}, "myGrid"); 

私は宣言的な方法が機能しないと信じています。

関連する問題