TAILIEUCHUNG - Flash Builder 4 and Flex 4 Bible- P14

Flash Builder 4 and Flex 4 Bible- P14: When Macromedia first released Flash MX in 2002, the product was branded as the new way to build Rich Internet Applications (known by the acronym RIA). The term was invented at Macromedia to describe a new class of applications that would offer the benefits of being connected to the Internet, including access to various types of Web-based services, but would solve many of the nagging issues that had been inherent in browser-based applications since the mid-1990s | Chapter 20 Using Advanced List Controls On the Web The code in Listing is available in the Web site files as in the chapter20 project. Figure shows the resulting application with formatted phone numbers in the last column of the DataGrid control. FIGURE A DataGridColumn with custom label formatting Using a dynamic data field As I described previously the custom formatting function for a DataGridColumn requires an argument that references the DataGridColumn that is calling the function. The purpose of this argument is to enable you to determine the data field of the current data item dynamically. For example if the data provider s data items have phone values in two different properties and you want to format them both with the same logic you can identify the property you want to format with the array-style expression item . The dataField property of the DataGridColumn returns the name of the property currently being processed so you need only one custom function to format as many data properties as needed private function getPhoneLabel item Object column DataGridColumn String var dataValue String item var pattern RegExp - g var phoneValue String pattern return phoneValue 621 Part III Working with Data Debugging a custom formatting function It can be instructive to add a trace statement to the body of a custom formatting function. As you scroll up and down in a DataGrid the trace statement in the custom function is executed each time the data grid column has to be formatted private function getPhoneLabel item Object column DataGridColumn String var dataValue String item var pattern RegExp - g var phoneValue String pattern trace original value dataValue formatted value phoneValue return phoneValue Figure shows the resulting output in Flash Builder s Console view when the application is

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.