Flex DataGrid×é¼þ
ʵ¼ÊÉÏ£¬DataGrid×é¼þÊÇÊôÓÚÁбí×é¼þµÄ£¬Ö®ËùÒÔµ¥¶ÀÄóöÀ´½²½â£¬Ö÷ÒªÊÇÒòΪ DataGrid×é¼þÓÐןÜÇ¿´óµÄ¹¦ÄÜ£¬Ò²ÓкܶàÀ©Õ¹µÄÓ¦ÓÃÊÇÔÚ¿ª·¢Öо³£Óõ½µÄ¡£DataGrid×é¼þÊǰ´ÕÕÐкÍÁеÄÐÎʽÏÔʾÊý¾ÝµÄ¡£Óм¸¸öÀàÊÇÖ»ÓÐ DataGrid×é¼þ²ÅÄÜʹÓõ쬰üÀ¨DataGridCellEditorÀà¡¢DataGridColumnÀàºÍHeaderRendererÀà¡£ÕâÈý ¸öÀà»áÔÚʹÓõÄʱºòÖð¸ö½²½â¡£
15.1 Êý¾ÝÍø¸ñ£¨DataGrid£©×é¼þ¼ò½é
DataGrid×é¼þÊʺÏÏÔʾ°üº¬¶à¸öÊôÐԵĶÔÏ󡣿ÉÒÔͨ¹ýÄÚ²¿»òÕßÍⲿµÄÊý¾ÝÔ´°ÑÊý ¾Ý°ó¶¨µ½DataGrid×é¼þÖС£DataGrid×é¼þÓкܶàÇ¿´óµÄ¹¦ÄÜ£¬Ê¹ÎÒÃÇÔÚ¿ª·¢ÖкÜÈÝÒ×µØÊµÏÖijЩ´úÂ룬±ÈÈ磬°´ÕÕÌØ¶¨µÄ¹æÔòÅÅÐò£¬ÔÚµ¥Ôª¸ñÖÐǶ ÈëÆäËû×é¼þµÈ¡£DataGrid×é¼þÓкܶàÊôÐÔ¡¢·½·¨ºÍʼþ¡£³£ÓõÄÊôÐÔÈç±í15.1Ëùʾ£¬³£Óõķ½·¨Èç±í15.2Ëùʾ¡£
±í15.1 DataGrid×é¼þ³£ÓõÄÊôÐÔ
Êô ÐÔ
˵ Ã÷
columns
»ñÈ¡»òÉèÖÃÒ»¸öDataGridColumn¶ÔÏóÊý×飬ÿ¸ö¿ÉÒÔÏÔʾµÄÁÐΪһ¸ö¶ÔÏó
editable
ָʾÓû§ÄÜ·ñ±à¼Êý¾ÝÌṩÕßÖеÄÏîÄ¿
editedItemPosition
»ñÈ¡»òÉèÖÃÕýÔڱ༵ÄÊý¾ÝÌṩÕßÏîÄ¿µÄÏîÄ¿äÖȾÆ÷µÄÁÐË÷ÒýºÍÐÐË÷Òý
editedItemRenderer
»ñÈ¡¶Ôµ±Ç°ÕýÔڱ༠......
ÎÒÒÔǰһֱ´ÓÊÂ×ÀÃæ¿ª·¢£¬ÓÈÆäÊý¾Ý´¦ÀíµÄµÄϵͳ½Ï¶à¡£Ê¹Óý϶àµÄÊÇ¿ª·¢¹¤¾ßÊÇVFP£¬ËüÓÐ×Ô´øµÄÊý¾Ý¿â£¬Ò²¿ÉÒÔʹÓôóÐ͵ÄÊý¾Ý¿âϵͳ£¬¼È¿ÉÒÔ¿ª·¢ÏµÍ³Ò²¿ÉÒÔÓÃÃüÁîÐнøÐйÜÀíÊý¾Ý¡£µ«£¬ËüÔÚ²»¾ÃµÄ½«À´¾ÍMS²»ÔÙ¸§ÑøÕâ¸öÂòÀ´µÄ¶ù×ÓÁË£¬²Ù×÷µÄϵͳµÄ»»´úµÈµÈ¶àÖÖÒòËØÓ°Ï죬²»¹ÜËüÊÇ·ñ»áÏûÍü£¬µ«Ê¼ÖÕÒ²»áÓ°Ïì¼ÌÐøÊ¹Óõġ£WEBµÄϵͳµÄÔçÒÑ¿ªÊ¼·¢Õ¹£¬ÍøÂçµÄ·¢Õ¹Ò²ÈÕÐÂÔÂÒ죬WEBµÄ¿ª·¢¼¼ÊõÒ²ÔÚ±ä¸ï¡£
WEB¿ª·¢ÊÇ·¢Õ¹·½Ïò£¬µ«¶ÔÎÒÕâλһֱ½øÐÐ×ÀÃæ¿ª·¢µÄÀÏÈ˼ң¬¶ÔÏÖÔÚÄÇô¶àµÄWEB¿ª·¢¼¼ÊõÓеãË®ÍÁ²»·þ£¬ÓÈÆäϰ¹ßÁË×ÀÃæ¿ª·¢·½Ê½ºÍϵͳµÄÔËÐз½Ê½¡£½ü¼¸Äê¶¼Ò»Ö±ÔÚÕÒ½ÏÊʺÏתÐ͵ļ¼Êõ¿ò¼Ü£¬ÕÒ¹ýºÜ¶àÖÖ£¬ÎÒ¿ª·¢µÄϵͳҪ½øÐдóÁ¿µÄÊý¾Ý¼ÈëµÄ£¬ËùÒÔÒªÔÚչʾ²ãµÄ×é¼þÐèÇó±È½Ï´ó£¬Òª¶ÔÊý¾ÝÊäÈë×é¼þµÄ¿ØÖƽ϶࣬ÐèÒª¶Ô½Ï¶à¿Í»§¶Ë¼ÈëÊý¾Ý½øÐÐÑéÖ¤£¬Èç¹û×ÜÊǰѴóÁ¿µÄÊý¾ÝÑéÖ¤¹¤×÷µ½·þÎñÆ÷¶ËÈ¥×öЧ¹û²»ÏÖʵ¡£
Ö±µ½2009ÄêϰëÄ꿪ʼ¶ÔADOBEµÄFLEXºÍACTIONSCRIPT½øÐÐÁ˽âºÍѧϰ£¬·¢ÏÖFELXÓзḻµÄUI×é¼þºÍ¿Í»§¶ËµÄʼþÄ£ÐÍ£¬ÊDZíʾ²ãµÄºÜºÃµÄÑ¡Ôñ£¬¿ª·¢½çÃæ¾ÍÈç×ÀÃæ¿ª·¢ÄÇÑù¡£FLEXÊDZàÒëÒ»¸öSWFÎļþ£¬ÔËÐÐÔÚFLASH²¥·ÅÆ÷µÄÀï£ ......
<?xml version="1.0"?>
<!-- charts/PredefinedAxisStyles.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<!--[CDATA[
//µ¼ÈëÏà¹Ø°ü
import mx.collections.ArrayCollection;
import mx.charts.*;
import mx.charts.series.items.ColumnSeriesItem;
import mx.charts.ChartItem;
import mx.charts.chartClasses.Series;
import mx.charts.chartClasses.IAxis;
import mx.utils.ObjectUtil;
[Bindable]
public var expenses:ArrayCollection = new ArrayCollection([
{Month:"Jan", Profit:20, Expenses:15},
{Month:"Feb", Profit:10, Expenses:20},
{Month:"Jun", Profit:30, Expenses:40},
{Month:"Aug", Profit:15, Expenses:25},
{Month:"Set", Profit:40, Expenses:45}
]);
public function myLabelFormat(obj:Object,pcat:Object,ax:LinearAxis):String
{
return numForm.format(obj)+"%";
}
private function setCustomLabel(element:ChartItem, seri ......
Are you running your Flex Application and continually getting the error below?
"Flex Builder cannot locate the required version of the Flash Player. You might need to install Flash Player 9 or reinstall Flex Builder. Do you want to try to run your application with the current version?"
Description:
This error is not a critical error and if you click on the Yes button the application will most likely run the way the you expect it. The reason this happened may have been because you recently did an express install or just an upgrade to your Flash Player.
Solution:
To get rid of this window constantly popping up you need to do one of the following:
1.Reinstall the Flash Player
Follow this link and reinstall the Flash Player. Get the latest Flash Player Debug Version
This may or may not solve the issue.
2.Put the missing file in the folder that Flex is expecting.
As you can tell Flex is looking for the dll in the folder C:\Program Files\Mozilla Firefox\plugins but if you look in ......
Are you running your Flex Application and continually getting the error below?
"Flex Builder cannot locate the required version of the Flash Player. You might need to install Flash Player 9 or reinstall Flex Builder. Do you want to try to run your application with the current version?"
Description:
This error is not a critical error and if you click on the Yes button the application will most likely run the way the you expect it. The reason this happened may have been because you recently did an express install or just an upgrade to your Flash Player.
Solution:
To get rid of this window constantly popping up you need to do one of the following:
1.Reinstall the Flash Player
Follow this link and reinstall the Flash Player. Get the latest Flash Player Debug Version
This may or may not solve the issue.
2.Put the missing file in the folder that Flex is expecting.
As you can tell Flex is looking for the dll in the folder C:\Program Files\Mozilla Firefox\plugins but if you look in ......
FlexÖÐͨ¹ý¼Ì³Ð¿ÉÒÔΪÐÂ×é¼þÔö¼ÓÐµĹ¦ÄÜ£¬Èçͨ¹ý×¢Èë·½·¨£¬¸Ä±ä±³¾°É«£¬¸Ä±äλÖú͸߶ȵȡ£ÕâÀïÖ÷ÒªÕÆÎÕÔ×é¼þµÄÒ»Ð©ÌØÐÔ£¬ÊôÐԺͷ½·¨£¬ÒÔ±ã¸ù¾ÝÐèÒªµÄ¹¦ÄܼÓÒÔ¸²Ð´£¨Ò²¿ÉÒÔ×Ô¼ºÀ©Õ¹£©£¬´ïµ½×Ô¼ºÏëÒªµÄЧ¹û¡£ÏÂÃæÊÇÒ»¸ö¼òµ¥µÄÀý×Ó
1¡¢Ð½¨MyDataGrid.as,¼Ì³ÐDataGrid,¸²Ð´drawRowBackground·½·¨£¬×¢ÈërowColorFunction·½·¨¡£
Java´úÂë
package com.test
{
import flash.display.Sprite;
import mx.controls.Alert;
import mx.controls.DataGrid;
import mx.controls.dataGridClasses.DataGridColumn;
public class MyDataGrid extends DataGrid
{
private var _rowColorFunction:Function;
& ......
CategoryAxisÓÐÒ»¸ö½Ð×ölabelFunctionµÄÊôÐÔ£¬Õâ¸öÊôÐԵ͍Ò壺ָ¶¨Ò»¸öº¯Êý£¬ÓÃÓÚ¶¨ÒåΪCategoryAxisµÄdataProviderÖеĸ÷¸öÏîÄ¿Éú³ÉµÄ±êÇ©¡£
ËùÒÔÐ޸ĵÄÔÀí£º¿ÉÒÔÀûÓÃlabelFunctionµÃµ½Ã¿¸öLabel£¬È»ºóÔÙ¶ÔÆä½øÐÐÐ޸ġ£
Ƭ¶Î´úÂ룺
<mx:horizontalAxis>
<mx:CategoryAxis id="ca"
categoryField="@date" title="August 2007" labelFunction="categoryAxisLabelFun" />
</mx:horizontalAxis>
private function categoryAxisLabelFun( item : Object, prevValue : Object, axis : CategoryAxis, categoryItem : Object) : String {
var temp : String = item as String;
return temp;
}
ÆäÖÐcategoryAxisLabelFunµÄ²ÎÊý£º
1¡¢item£º±£´æµÄ¾ÍÊÇLabelÀïÃæÎÄ×ÖÐÅÏ¢¡£
2¡¢prevValue£º×ø±êÖáÉÏÃæ£¬Ç°Ò»¸öÀà±ðµÄÖµ¡£
3¡¢axis£ºCategoryAxisµÄʵÀý»¯¶ÔÏó¡£
4¡¢categoryItem£ºÊǽ«Òª³ÊÏÖµÄdataProviderÖеÄÏîÄ¿¡£
ËùÒÔÓë±êÇ©ÓйØÏµµÄÖ»ÓеÚÒ»¸ö²ÎÊý£ºitem¡£
ÒÔÏ´úÂë·Ö±ðÊǶÔCategoryAxisµÄ±êÇ©½øÐÐÐÞ ......