In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
The editor will share with you what the concepts of Flex Dataprovider and Data are. I hope you will get something after reading this article. Let's discuss it together.
Flex Dataprovider and Data concept
1 、 Flex Dataprovider
The definition in AdobeActionScript3.0 is as follows:
The dataset to view, this property allows you to use most types of objects as data providers. If the Flex Flex Dataprovider property is set to Array, it is converted to ArrayCollection. If you set this property to a XML object, it is converted to a XMLListCollection that contains only one project. If you set this property to XMLList, it is converted to XMLListCollection. If you set this property to an object that implements the IList or ICollectionView interface, you can apply this object directly. Affected by the conversion operation, when you get the Flex Dataprovider property, the property value will always be ICollectionView, so this value is not necessarily the object type you set. If you are modifying data in a data provider, it is important to understand that changes made to the original data may not be detected, but changes made to the ICollectionView object obtained from the Flex Dataprovider property will be detected. The default value is null. This property can be used as a source for data binding.
The pile of stuff on ◆ actually illustrates the following points:
A, all components with Flex Dataprovider can use Array, XML and other content as data sources.
B. automatically bind and display these contents as data sources on these controls.
So in general, when Flex gets the external data, it can be directly assigned to Flex Dataprovider, and then through some settings, you can display the data on these components.
I'm not going to repeat this example here. You can find it by yourself, or look directly at the content here: http://livedocs.adobe.com/flex/3_cn/mx/controls/ComboBox.html#includeExamplesSummary.
2. ItemRenderer (project renderer) and its Data properties.
The function of itemRenderer is to customize the project display effect of some components, such as Combobox, List, DataGrid and so on. In other words, we can use itemRenderer to improve the display effect of the drop-down in ComBoBox. Of course, the same is true of List and DataGrid.
When you customize a renderer in ComboBox and bind a data source using Flex Dataprovider, how does it work with the item in our custom renderer? Is to use the data method.
In other words, Flex Dataprovider can bind data to UI, and if this component uses a custom renderer, then you can use data.XXX to get the data in Flex Dataprovider.
Okay, the two knowledge points described above are about the data processing capabilities of Flex components, in which Flex Dataprovider can bind and display Array, XML and other contents directly to UI as data sources, while data in itemRenderer is the data processing between the component and its renderer.
◆ 's next article is about several common ways for Flex to communicate with the background: HTTPService, WebService, Remote, etc., which can easily make some mainstream programming languages such as Java, C#, Python, Ruby, PHP and other mainstream programming languages serve Flex:)
Attach:
The specific uses of Flex Dataprovider, itemRenderer, and data are somewhat abstract, so I would like to give an example to illustrate.
This is a HorizontalList component, and its itemRenderer=ToolBoxRenderer wants us to take a look at the snippet code of HorizontalList:
Then there is the snippet code of ToolBoxRenderer:
◆, let's take a look at how itemRenderer relates to our topic today.
1. A Flex Dataprovider is defined in myHorizontalList. You can see from the code that it is a variable of type Array, and then assign it to Flex Dataprovider. At this point, you should actually display the data on myHorizontalList, which is the use of Flex Dataprovider.
2. In the Array included in Flex Dataprovider, define the following structure:
3. We not only set Flex Dataprovider, but also set itemRenderer, that is, ToolBoxRenderer.
4. In ToolBoxRenderer, a Button is defined, and we can get the data in Flex Dataprovider in a way like this: toolTip= "{data.tooltip}"
After reading this article, I believe you have a certain understanding of "what is the concept of Flex Dataprovider and Data". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.