Hi
   I came across a weird requirement in my project with datagrids,
hope someone can help me out. I'm a newbie so im sorry if i'm doing
anything wrong.
     Lemme post the Code to describe the problem better:
ActionScript:
[QUOTE]
package com
{
        public class AccountHolder
        {
                private var _name:String;
                private var _balance:String;
                private var _accnum:String;

                public function AccountHolder()
                {
                }
                public function get name():String
                {
                        return _name;
                }
                public function set name(value:String):void
                {
                        _name=value;
                }
                public function get balance():String
                {
                        return _balance;
                }
                public function set balance(abalance:String):void
                {
                                _balance=abalance;
                }
                                public function get accnum():String
                {
                                return _accnum;
                }

                public function set accnum(aaccnum:String):void
                {
                        _accnum=aaccnum;
                }
        }

}

[/QUOTE]

& this is the mxml part
[QUOTE]
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute" backgroundGradientAlphas="[1.0, 0.8]"
backgroundGradientColors="[#018CA5, #030303]" width="1216"
height="896">
<mx:Script>
        <![CDATA[
                import mx.controls.Alert;
                        import com.AccountHolder;
                        import mx.collections.ArrayCollection;
                        [Bindable]
                        private var accholder:AccountHolder=new AccountHolder;
                        [Bindable]
                        private var accInfo:ArrayCollection = new 
ArrayCollection();
                        private var txnArray:ArrayCollection = new 
ArrayCollection();

                        public function btnSubmitHandler():void // event to add 
acc info to
datagrid
                        {
                                var accholder:AccountHolder=new AccountHolder();

                                accholder.name=nameInput.text;
                                accholder.accnum=accnumInput.text;
                                accholder.balance=amtInput.text;
                                //Alert.show(accholder)
                                accInfo.addItem(accholder);
                                datagrid.dataProvider=accInfo;
                                refresh();
                        }
                        public function refresh():void // event to clear text 
fields from
textInput
                        {
                                nameInput.text='';
                                accnumInput.text='';
                                amtInput.text='';
                        }
        ]]>
</mx:Script>
<mx:DataGrid id="datagrid" y="39" width="536" sortableColumns="false"
resizableColumns="false" horizontalCenter="13">
                <mx:columns>
                        <mx:DataGridColumn headerText="Name" dataField="name"/>
                        <mx:DataGridColumn headerText="Acc #" 
dataField="accnum"/>
                        <mx:DataGridColumn headerText="Amount/Balance" 
dataField="balance"/
>
                </mx:columns>
                </mx:DataGrid>
                <mx:Form y="226" width="266" height="148" x="37">
                <mx:FormItem label="Name" color="#FCFCFC" fontWeight="bold"
width="213">
                        <mx:TextInput id="nameInput" color="#F90000"/>
                </mx:FormItem>
                <mx:FormItem label="Acc" color="#FCFCFC" fontWeight="bold">
                        <mx:TextInput id="accnumInput" color="#FC0404"/>
                </mx:FormItem>
                <mx:FormItem label="Amt" color="#FCFCFC" fontWeight="bold">
                        <mx:TextInput id="amtInput" color="#FF0606"/>
                </mx:FormItem>
                <mx:FormItem fontWeight="bold" color="#FBFDFE">
                        <mx:Button label="Submit" click="btnSubmitHandler()"/>
                </mx:FormItem>
        </mx:Form>
        <mx:Panel x="363" y="216" width="355" height="200" layout="absolute"
title="Money Transfer">
                <mx:Label x="0" y="12" text="From Account:" fontWeight="bold"
color="#040404"/>
                <mx:Label x="17" y="61" text="To Account:" fontWeight="bold"
color="#000000"/>
                <mx:TextInput id="fromAcc" x="97" y="10"/>
                <mx:TextInput id="toAcc" x="97" y="59"/>
                <mx:Label x="34" y="109" text="Amount:" fontWeight="bold"
color="#010101"/>
                <mx:TextInput  id="debitAmt" x="97" y="107"/>
                <mx:Button x="254" y="137" label="Confirm"/>
        </mx:Panel>
</mx:Application>
 [/QUOTE]

so here's the problem. the third column in the datagrid is where i'm
having issues.
the third column will specify the balance in the user's bank balance.
If you go through the code you can see that the insertion of entries
into the datagrid works fine. Now suppose there are two entries in the
datagrid and i want to transfer some amount from  user1 to user 2 by
specifying the entries in the panel, i.e the amt should be debited
from user1's balance n credited into user2's balance and all the
changes should reflect at the same time. Would this be possible? .
Thanks.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to