2014-12-04 3 views
1

동적 글꼴 크기를 만드는 방법을 알아 내려고하는 dxTab가 있습니다.dxTab 동적 글꼴 크기

<div data-bind="dxTabs: { dataSource: SurveyQuestions, selectedIndex: currentIndex }"> 
    <div data-options="dxTemplate: {name: 'item'}"> 
     <div data-bind="text: text " style="font-size: 20px;"></div> 
    </div> 
</div> 

글꼴 크기를 대신 또는 데이터베이스에 글꼴 크기에 변수를 넣을 수있는 방법이 있습니까?

기본적으로 최대 5 개의 탭이있을 수 있지만 5 개의 탭이 있으면 모든 텍스트를 볼 수 없으므로 추가 탭으로는 2px까지 텍스트를 축소합니다.

답변

0

당신은 그런 식으로 뭔가를 할 수 :

<div data-bind="dxTabs: { dataSource: SurveyQuestions }"> 
    <div data-options="dxTemplate: { name: 'item'}"> 
     <div data-bind="text: text, 
      style: { fontSize: $parent.SurveyQuestions.length < 5 ? '16px' : '12px' }"></div> 
    </div> 
</div> 

는 바이올린 참조 : http://jsfiddle.net/tabalinas/pmbuw7t2/

을하지만 그것이 최선의 해결책이다 모르겠어요. 새로운 14.2 버전에서 dxTabs는 스크롤을 지원합니다. https://www.devexpress.com/Support/Center/Question/Details/S171952

희망이 도움이 될 수 있습니다.