2012-01-26 4 views
3

dojo ContentPane을 사용하여 openlayers 맵을 렌더링하고 있습니다. DOM이 준비되고지도가 삽입되면 dijit의 sytle을 덮어 씁니다. CSS의 높이와 너비를 클래스와 ID로 명시하고 HTML을 인라인으로 시도했습니다.Dojo data-dojo-props 스타일이 덮어 쓰기

은 내 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

나는 이것을 도조 격자에서 시도했지만 작동하지 않습니다. 나는 당신이 자바 스크립트 코드에서 그것을 시도하는 것이 좋습니다.

너비 및 높이 특성이있는 스타일 개체를 컨테이너 개체에 추가하십시오.

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

나는 선언적인 방식으로 작동하지 않는다고 생각합니다.