View sample for “Tooltip for DataGrid Column Elements.” Post
July 29, 2008
Leave a Comment » |
Flex related, samples | Tagged: datagrid tooltip, example, sample, Tooltip |
Permalink
Posted by kumargandhi
Code Example on “Setting dynamically rowCount property on DataGrid.”
July 23, 2008Code Example on “Setting dynamically rowCount property on DataGrid.”
<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”absolute” creationComplete=”init()”>
<mx:Script>
<![CDATA[
private function init():void
{
dg.dataProvider=arr;
dg.rowCount=arr.length;
}
]]>
</mx:Script>
<mx:DataGrid x=”260″ y=”125″ id=”dg” rowCount=”2″>
<mx:columns>
<mx:DataGridColumn headerText=”Names” dataField=”label” />
</mx:columns>
</mx:DataGrid>
<mx:Array id=”arr”>
<mx:Object label=”Kumar1″/>
<mx:Object label=”Kumar2″/>
<mx:Object label=”Kumar3″/>
<mx:Object label=”Kumar4″/>
<mx:Object label=”Kumar5″/>
<mx:Object label=”Kumar6″/>
</mx:Array>
</mx:Application>
Here when you run the example you can see the rows of the DataGrid changing.as that of the property.
The actual post is here and this is the code example of that post.As the viewer requested.
Enjoy the post.Comments are welcome.
2 Comments |
Flex related, tutorials | Tagged: code example, dynamic rowCount of DataGrid control.., rowcount |
Permalink
Posted by kumargandhi
A Flex Application done to File your Income Tax Returns, awaiting comments.
July 18, 2008Dear Friends,
My Team members have done one Application in Flex where in you can File your Income Tax Returns, and one small Utility in Flex where in you can do Tax calculation called Tax Calci [with my involment].
As Its very important to file your Income Tax returns, Just go ahead and file your return, 31-07-2008 [India]is the last date to file your returns
And the Links are www.saralefile.com – Here you can file your individual income tax returns
And Tax Calculator Utility Link : www.taxcalc.saralefile.com
And guess what its Free?
The comments are welcome and we are awaiting for that.
With Regards,
K.Kumar Gandhi.
2 Comments |
Flex and PHP related.., javascript | Tagged: ITR in Flex, Tax Calci in Flex |
Permalink
Posted by kumargandhi
New DateField/New ComboBox Component With BackgroundColor Property Sample.
July 14, 2008Last Month i have made post on how to create DateField Component and ComboBox Component with BackgroundColor Property[custom Components], here i have made a sample on it and uploaded.
Can check it out here, click there to check
Comments are welcome.Enjoy the Sample.
2 Comments |
Flex related, custom components | Tagged: custom combobox components, custom components, customdatefield component. |
Permalink
Posted by kumargandhi
Using the (… args) Operator.
July 10, 2008The usage is so simple and clear. Using this operator we can pass n number of variables values and hold them for calculation.The variable can be of any type and the final args contains the array of elements we pass.the below example will make you clear.
Flex Code Example:
CreationComplete=”init()” –>Call this on Application creation.
scrpt Code
private function init():void
{
lbl.text=String(average(100,100,100,100,100));
}
private function average(… args):Number
{
var sum:Number=0;
var i:int;
for(i=0;i<args.length;i++)
{
sum+=args[i];
}
return sum/args.length;
}
MXML code
<mx:Label id=”lbl” />
Enjoy the Post and Operator. Make your code simple.
Leave a Comment » |
Flex related | Tagged: operator, variables |
Permalink
Posted by kumargandhi
Tooltip for DataGrid Column Elements.
July 9, 2008Here itemRenderer comes into play.The below code will given on idea how this is achevied but you need to go through the Classes.
Flex App.mxml code
<?xml version=”1.0″ encoding=”utf-8″?>
<mx:TitleWindow xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”absolute” width=”700″ height=”300″
creationComplete=”projectsSrv.send();”>
<mx:HTTPService
id=”projectsSrv”
url=”projects.php.xml”
useProxy=”false” method=”POST”>
</mx:HTTPService>
<mx:DataGrid dataProvider=”{projectsSrv.lastResult.records.record}” width=”370″ x=”23″ y=”10″>
<mx:columns>
<mx:DataGridColumn dataField=”label”>
<mx:itemRenderer>
<mx:Component>
<mx:Label>
<mx:Script>
<![CDATA[
override public function set data(value:Object):void
{
super.data = value;
this.toolTip = data.label;
this.selectable = true;
super.invalidateDisplayList();
}
]]>
</mx:Script>
</mx:Label>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
</mx:TitleWindow>
projects.php.xml code.
<records>
<record data=”1″ label=”Corco”/>
<record data=”5″ label=”Shell Crop Protection”/>
<record data=”7″ label=”Olin McIntosh”/>
<record data=”9″ label=”Crab Orchard”/>
<record data=”10″ label=”Shell Oil Del Amo”/>
<record data=”11″ label=”AIG South Jersey Gas”/>
<record data=”12″ label=”Husch & Eppenberger Litigation-New York”/>
<record data=”22″ label=”Shell Sturbridge”/><record data=”24″ label=”Shell Southington”/>
<record data=”26″ label=”Olin Personal Injury”/>
</records>
The projects.php.xml is a xml file in the same directory. Now when you run the file you can see the Tooltip on the row element , similarly you can mention for other columns.
Enjoy the Post and code. Comment me for queries.
3 Comments |
Flex related | Tagged: datagrid, httpservice, itemrenderer, PHP XML data.., Tooltip, xml |
Permalink
Posted by kumargandhi
How to Print contents of a Container (Canvas) ?
July 3, 2008Here iam having two Two containers (canvas) with my data in it and now I want to print the contents of the canvas as a whole.
Two containers [canvas] à PrintPreviewL,PrintPreviewR
Now I want to print the contents of these containers.
The function which does the print is :
public function doPrint():void
{
// Create a FlexPrintJob instance.
var printJob:FlexPrintJob = new FlexPrintJob();
// Start the print job.
if(printJob.start()) {
// Create a PrintView control as a child
// of the current view.
var formPrintViewL:PrintPreviewL = new PrintPreviewL ();
var formPrintViewR: PrintPreviewR = new PrintPreviewR();
addChild(formPrintViewL);
addChild(formPrintViewR);
// Add the SimplePrintview control to the print job.
// For comparison, try setting the
// second parameter to “none”.
printJob.addObject(formPrintViewL);
printJob.addObject(formPrintViewR);
// Send the job to the printer.
printJob.send();
// Remove the print-specific control to free memory.
removeChild(formPrintView);
removeChild(formPrintViewT);
}
}
This will print the contents of the two canvas in sequence as we send to the printJob.As you can see.
Can go through the classes to learn the Basics and start. All the Best.
Enjoy the code !
, leave me comments for queries.
1 Comment |
Flex related | Tagged: canvas, container, print |
Permalink
Posted by kumargandhi
Using NumberFormatter !
July 2, 2008This class is used to format the number in a way we like, like the number 2000 to 2,000 or 2000 to 2,00.00 or 2000.2345 to 2,000.23 like that.So the usage is given below, its like the beautification to the data.
Code Example:
<mx:NumberFormattter id=”nftr” precision=”2″ />
Now in a the Script block u can use this to format the number.As
nftr.format(2000.123456);
This will format to 2,000.12.
There are still many properties in the NumberFormatter class to use like thousandSeperatorfrom,thousandSeperatorto …… like so, can explore these very simple.
As i said it addds beautification to the data in the Application.
Enjoy the post.Can leave a comment for queries.
Leave a Comment » |
Flex related | Tagged: class., NumberFormmater |
Permalink
Posted by kumargandhi