Flex Tree ToolTip 设定

Categories: Flex; Tagged with: ; @ October 14th, 2009 17:18

为节点或叶子设定其特有之ToolTip:

	// Constructor
	public function TreeForCodeMaintain(codeMaintainService_:ICodeMaintainService) {
		super();
		_codeMaintainService = codeMaintainService_;
		dataProvider =  dataProvider = ["code1", "code2", "code3", ["folder1", ["subCode1", "subCode2", ["subFolder1", ["sc1", "sc2"]]]]];
		dataDescriptor = new TreeDDForCodeMaintain();
		labelFunction = labelFunForTree;
		dataTipFunction = dataTipFunctionForTreeCode;
		showDataTips = true;
	}
	
	protected function dataTipFunctionForTreeCode(item:Object):String {
		if(item is Array) {
			return String(item[0]);
		}
		// return item.toString();
		return AppContext.getInstance().metaDomain.getEntityByName(String(item)).descriptionLocalized;
	}

效果:

 

image

<->



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.