[flexcoders] drag and drop re-sort canvases in VBOX

2009-03-18 Thread samata
Hi,
I am looking for any example of implementing a drag and drop re-sort within a 
vbox container. Basically I have a Vbox that contains a number of canvas's that 
are full width and 50px high. I want to be able to drag and drop them to 
re-order within the vbox.




[flexcoders] summaryFunction in Editable AdvancedDatagrid

2009-03-05 Thread samata
Hi all,

I am using Advanced Data grid for the first time. It is editable in nature. I 
am unable to display the 'SUM' of the grouped collections corrected after i 
edit the Text Inputs in the grid.

This is my code:

MainFile.mxml:

?xml version=1.0 encoding=utf-8 ? 
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical 
initialize=init()
 
 mx:Script
![CDATA[
import mx.collections.ArrayCollection;
import mx.events.AdvancedDataGridEvent;
import mx.events.DataGridEvent;
import mx.events.ListEvent;
import mx.controls.List;
import mx.events.ItemClickEvent;
import mx.collections.IViewCursor;
import mx.controls.Alert;
import mx.controls.TextInput;

[Bindable]public var num1:Number;
[Bindable]public var num2:Number;
[Bindable]public var num3:Number;
[Bindable]public var num4:Number;
[Bindable]public var num5:Number;
[Bindable]public var num6:Number;

public var newVal:String;
[Bindable]
public var myArrayCollection:ArrayCollection;

private function func(itr:IViewCursor,field:String, 
str:String=null):Object
{
myArrayCollection.refresh();
var sum:Number=0;
while(!itr.afterLast)
{
//trace(itr.current)
var value:Number = Number(itr.current.Profit);
//Alert.show(Number(itr.current.Profit)+);
if(!isNaN(value))
{
sum+= value;
//Alert.show(sum+);
}
itr.moveNext()
}
//Alert.show(sum+sum);
return sum;
}

public function init():void {
myArrayCollection = new ArrayCollection(arr);
}

 private function getCellInfo(event:AdvancedDataGridEvent):void 
{

   myArrayCollection.refresh();
   summaryField.summaryFunction=func;// i m trying to call the 
function to update the sum(total) of the grouped collection after user edits it.
  }
  

]]
 /mx:Script
 mx:Array id=arr
  mx:Object From=a1 Subject=a Date=12/08/06 Profit={num1}/ 
  mx:Object From=b1 Subject=b Date=12/08/06 Profit={num2}/ 
  mx:Object From=c1 Subject=c Date=12/08/06 Profit={num3}/
  mx:Object From=d1 Subject=d Date=12/08/06 Profit={num4}/ 
 mx:Object From=a1 Subject=e Date=12/07/06Profit={num5}/ 
  mx:Object From=f1 Subject=f Date=12/07/06 ={num6}/
  /mx:Array
 mx:AdvancedDataGrid id=adg displayItemsExpanded=true 
creationComplete=gc.refresh(); 
height=300 editable=true itemEditEnd=getCellInfo(event);
 mx:dataProvider
 mx:GroupingCollection id=gc source={myArrayCollection}
 mx:Grouping
 mx:GroupingField name=From
 mx:SummaryRow summaryPlacement=last
 mx:fields
  mx:SummaryField 
dataField=Profit label=summary summaryFunction=func id=summaryField/ 
 /mx:fields
  /mx:SummaryRow
  /mx:GroupingField
  /mx:Grouping
  /mx:GroupingCollection
  /mx:dataProvider
 mx:columns
  mx:AdvancedDataGridColumn id=col1 dataField=From/ 
  mx:AdvancedDataGridColumn dataField=Subject / 
  mx:AdvancedDataGridColumn dataField=Date / 
  mx:AdvancedDataGridColumn dataField=CC / 
  mx:AdvancedDataGridColumn dataField=Profit/ 
  /mx:columns
 mx:rendererProviders
  mx:AdvancedDataGridRendererProvider column={col1} columnSpan=0 depth=2 
dataField=summary renderer=SummaryRenderer / 
  /mx:rendererProviders
  /mx:AdvancedDataGrid
  /mx:Application

SummaryRenderer.mxml:

?xml version=1.0 encoding=utf-8 ? 
mx:Label xmlns:mx=http://www.adobe.com/2006/mxml; textAlign=center
mx:Script
![CDATA[
import mx.controls.Alert; 
import mx.collections.GroupingCollection;
import mx.collections.IHierarchicalCollectionView;
import mx.controls.AdvancedDataGrid;

override public function set data(value:Object):void
{
super.data = value;

var userName:String = ;
   

[flexcoders] XMLList obtained after filtering to act as dataprovider to datagrid

2008-09-11 Thread samata
Hi,

I want the XMLList obtained after filtering to act as dataprovider 
to my datagrid...

Can some1 help me plz??

This is my code:

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; 
layout=absolute creationComplete=init();
mx:Script
![CDATA[
import mx.controls.Alert;

[Bindable]
public var myList:XML=new XML();
public var fil:XMLList = new XMLList(); 


public var input:XML=
head
  story main=Most Popular
subMost Popular/sub
rating2/rating
descSolo journey to the north pole/desc
imgimages/one.jpg/img
link/link
code1/code
  /story
  
  story main=Most Popular
subAmbition/sub
rating1/rating
desconly time will tell/desc
imgimages/two.jpg/img
link/link
code1/code
  /story
  
  story main=Most Popular
subLifestyle/sub
rating3/rating
descany thing can do/desc
imgimages/three.jpg/img
link/link
code1/code
  /story
  
 story main=Ambitions
subAmbition/sub
rating4/rating
descFamily time story/desc
imgimages/four.jpg/img
link/link
code1/code
/story
 /head;

private function addUniqueValue(value:Object, 
list:XMLList):XMLList
{
if(!list.contains(value))
{
list += value;
}
return list;
}  

public function init():void
{
 var x:XMLList = input.story.(@main == Most 
Popular).sub; 
  for(var i=0;i  x.length();i++) 
{
Alert.show(x[i]);
}  

input.descendants().(fil = addUniqueValue
(attribute(main), fil));
myList.appendChild(fil);/*i want to add 'fil' to 
datagrid as dataprovider*/
 }
]]
/mx:Script

  mx:HBox height=40%
 mx:DataGrid id=source dataProvider={myList} 
width=100% rowCount=5 height=152 
paddingLeft=0 paddingBottom=0 
paddingRight=0  paddingTop=0 wordWrap=true rowHeight=30 
fontSize=12 showHeaders=false 
backgroundColor=#003399 
selectionColor=#578693 
horizontalGridLines=true horizontalGridLineColor=#7a7d7d 
horizontalScrollPolicy=off 
verticalScrollPolicy=off fontFamily=Arial 
verticalGridLines=false 

mx:columns
mx:DataGridColumn dataField=main 
textAlign=left/
mx:DataGridColumn dataField=rating 
textAlign=right/
/mx:columns 

 /mx:DataGrid
   /mx:HBox 

/mx:Application

Thanx,
sam



[flexcoders] round only two corners of the text input component

2008-09-05 Thread samata
Hi,

I want to round only two corners of the text input component(upper-
left and upper-right)could some1 help me plz???

Thanx,
sam



[flexcoders] change direction of the combo box opening

2008-08-27 Thread samata
Hi,

I wanted to know how to change direction of the combo box opening and 
closing?? I wanted to open it sideways to right.

It always drops down na...

Thanx in advance,

samata.



[flexcoders] Re: change direction of the combo box opening

2008-08-27 Thread samata
--- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote:

 PopUpMenuButton?
 
  
 
 From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
 Behalf Of samata
 Sent: Wednesday, August 27, 2008 6:55 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] change direction of the combo box opening
 
  
 
 Hi,
 
 I wanted to know how to change direction of the combo box opening 
and 
 closing?? I wanted to open it sideways to right.
 
 It always drops down na...
 
 Thanx in advance,
 
 samata.


Alex,

I want the list of items in combobox to be displayed sideways ie to 
right on clickingNormally when u click on combobox the list 
drops downwards na!!!




[flexcoders] setting the value of axis label in line chart which is populated dynamically!

2008-07-28 Thread samata
Hi,

I have  line chart..The line charts has values that are populated 
dynamically.
 
The values could be anything...ranging from 100 to 10 or more.

i wanted 2 know if there is some way one could identify the maximum 
value plotted and set it to value higher than that at runtime...to 
avoid this prob.

I have come across properties like computedMaximum and 
computedMinimum but they are protected properties in Flex 2

I am using flex 2...

thanx in advance,
sam


 
 




[flexcoders] Re: setting the value of axis label in line chart which is populated dynamically!

2008-07-28 Thread samata
--- In flexcoders@yahoogroups.com, Amy [EMAIL PROTECTED] wrote:

 --- In flexcoders@yahoogroups.com, samata samata.rao@ wrote:
 
  Hi,
  
  I have  line chart..The line charts has values that are 
populated 
  dynamically.
   
  The values could be anything...ranging from 100 to 10 or 
more.
  
  i wanted 2 know if there is some way one could identify the 
maximum 
  value plotted and set it to value higher than that at 
runtime...to 
  avoid this prob.
  
  I have come across properties like computedMaximum and 
  computedMinimum but they are protected properties in Flex 2
  
  I am using flex 2...
  
  thanx in advance,
 
 Not sure about Flex 2, but in Flex 3 I use something like:
 
 private function setChartProperties(chart:LineChart):void{
 //I find if you just go straight to it without casting it, 
 //some properties will tell you they are read only
 var va:LinearAxis = chart.verticalAxis as LinearAxis
 if (myCondition) {
 va.maximum=800;
 va.minimum=200;
 va.title='Title for condition true';
 } else {
 va.maximum = 100;
 va.minimum = -10;
 va.title='Title for condition false';
 }
 }
 HTH;
 
 Amy

Thanx 4 reply Amy...
But i need the soln For Flex 2...
V r using that 4 our project:-))