(가 ASDOCs에서 @private
표시된 것) enbaledField
라는 NavBar
구성 요소의 특성 문서화되지 않은 것으로 보인다. TabBar
구성 요소는 클래스 계층 구조의 어느 지점에서 NavBar
까지 확장됩니다. 그래서 이론적으로
/**
* @private
* Storage for the enabled property.
*/
private var _enabledField:String = "enabled";
[Bindable("enabledFieldChanged")]
[Inspectable(category="Data")]
/**
* Name of the the field in the <code>dataProvider</code> object
* to use as the enabled label.
*
* @default "enabled"
*
* @langversion 3.0
* @playerversion Flash 11.1
* @playerversion AIR 3.4
* @productversion Flex 4.10
*/
public function get enabledField():String
{
return _enabledField;
}
(I 플렉스 중 하나를 설치하지 않은) 경우 요소 : 여기
은 (당신이 ASDOC 코멘트를 읽을 수 있도록 단지 포함) 아파치 플렉스 GitHub의의의 repo에서 코드입니다
dataProvider
에
enabled
이라는 속성이있는 경우
TabBar
에서 개별 버튼을 사용 중지 할 수 있습니다.
또는 dataProvider 요소의 다른 필드를 사용하여 단추를 활성화/비활성화해야 함을 나타내려면 enableField
속성에 새 값을 설정할 수 있습니다.
ASDOC이 이것이 Flex 4.10에 처음 포함되었다고 말한 것 같습니다. 그러나 이것은 이전 MX 구성 요소이므로 이상하다고 생각합니다. 그러나이 속성이 실제로 Flex 4.10에 추가 된 것일 수 있습니다.
사실,이 코드는 Flex 4.10에서만 사용 가능합니다. 코드의 각 비트를 복사하여 @zeus로 직접 구현할 수 있습니다. 마법이 일어나는 NavBar
클래스의 private 메소드 createNavChildren()
의 특정 만들기에 대 한 참고에서 :
//Check for enabled field and assign it to the individual button if it exists.
if (_enabledField != "" && item.hasOwnProperty(_enabledField) == true)
{
navItem.enabled = Boolean(item[_enabledField]);
}
else
{
navItem.enabled = enabled;
}
Here is a link 위의 모든 코드를 가지고 github에의 환매 특약의 클래스 NavBar
합니다.
직접 솔루션이없는 것처럼 보이지만 탭 표시 줄을 확장하고 데이터 공급자 속성을 재정의해야 할 수 있습니다. 귀하의 dataprovider 개체는 아래와 같이됩니다. 자식 탭 버튼을 활성화 또는 비활성화하려면 updateDisplayList/commitProperties를 재정의해야합니다.
Zeus