Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Flex DataGrid in flex
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


bikrantsingh
DataGrid in flex
1 Answer(s)      4 years ago
Posted in : Flex


Hi.......

I want to know about
How do you access methods in DataGrid from external itemRenderers?
please give an example so i can clearly understand....

Thanks


Advertisement
View Answers

October 21, 2010 at 1:03 PM


Ans:

The following example will be helpful for you please try it.

main.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
width="300" height="150"
layout="absolute" 
creationComplete="init()">
  <mx:Script>
   <![CDATA[
     import mx.collections.ArrayCollection;

     [Bindable]
     private var items:ArrayCollection;

     private function init():void
     {
       items = new ArrayCollection();
       items.addItem(new NameItem("A", true));
       items.addItem(new NameItem("B", false));
       items.addItem(new NameItem("C", false));
       items.addItem(new NameItem("D", true));
       items.addItem(new NameItem("E", false));
     }
   ]]>
 </mx:Script>
<mx:DataGrid dataProvider="{items}" 
  editable="true" width="100%" height="100%">
    <mx:columns>
        <mx:DataGridColumn headerText="Name" 
         dataField="name" editable="false" />
        <mx:DataGridColumn headerText="Access" 
           dataField="access"
           itemEditor="ComboEditor" 
           editorDataField="newValue" width="125"/>
    </mx:columns>
  </mx:DataGrid>
</mx:Application>

The NameItem class is following

package
{
  [Bindable]
  public class NameItem
  {
    public var name:String;
    public var access:Boolean;

    public function SimpleItem(name:String, access:Boolean)
    {
      this.name = name;
      this.access = access;
    }
  }
}

ComboEditor.mxml as an itemrenderer

<?xml version="1.0" encoding="utf-8"?>
<mx:Box xmlns:mx="http://www.adobe.com/2006/mxml" 
width="100%" height="100%" horizontalAlign="center">
  <mx:Script>
   <![CDATA[
     override public function set data(value:Object):void
     {
       super.data = value;
       newValue = value.access;
     }
   ]]>
 </mx:Script>
  <mx:Boolean id="newValue" />
  <mx:ComboBox id="comboItem" selectedIndex="{data.access ? 0 : 1}"
     change="{newValue = (comboItem.selectedIndex == 0)}">
    <mx:dataProvider>
      <mx:Array>
        <mx:String>Yes</mx:String>
        <mx:String>No</mx:String>
      </mx:Array>
    </mx:dataProvider>
  </mx:ComboBox>
</mx:Box>


Related Tutorials/Questions & Answers:
DataGrid in flex
DataGrid in flex  Hi.... What kind of data grids you can create through Flex applications? please tell me about the datagrid so i can implement it in my application .... Thanks
DataGrid in flex
DataGrid in flex  Hi.... please provide the solution of that problem When I have only a single record, why doesn't it appear in my DataGrid? please give an example Thanks  Ans: This is a caused in flex
Advertisements
DataGrid in flex
DataGrid in flex  Hi.... Please tell me What is the data type of the dataprovider property in DataGrid? please give an small example for that.... Thanks
DataGrid in flex
DataGrid in flex  Hi..... Please tell me about DataGrid extends which class? please give me the syntax......... Thanks
DataGrid in flex
DataGrid in flex  Hi....... I want to know about How do you access methods in DataGrid from external itemRenderers? please give an example so i can clearly understand.... Thanks
DataGrid in flex
DataGrid in flex  Hi........ Please provide the solution of that problem When I add or modify an item in my dataProvider, why doesn't it show up in my DataGrid? Thanks in advance  Ans: When you work
DataGrid in Flex
Adobe Flex DataGrid: In Flex, DataGrid is a kind of list which can display... column. Adobe Flex DataGrid provides many features like columns can be resized...;mx:ArrayCollection> and <mx:Object> tags. Adobe Flex Datagrid
Flex DataGrid control
DataGrid in Flex:- A DataGrid is a control in flex which is display data... and display via custom renderers. The main features of the DataGrid is that, you can... a DataGrid and what is the procedure to provide data by array collection
How to add a DropDown List in Flex DataGrid
How to add a DropDown List in Flex DataGrid  hi I am trying to add a DropDownList in a DataGrid table. After the user selects one of the items from... a dropDownList in dataGrid. Pls can u tell me how the selected item in my
How to add a DropDown List in Flex DataGrid
How to add a DropDown List in Flex DataGrid  hi I am trying to add a DropDownList in a DataGrid table. After the user selects one of the items from... a dropDownList in dataGrid. Pls can u tell me how the selected item in my
datagrid
datagrid   please send datagrid in jsp lot fields including date
DataGrid ItemRenderer
DataGrid ItemRenderer  Hi... I have a datagrid which contains a Spark dropdownlist that needs to obtain dynamic data. The datagrid uses a separate.../flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955
Datagrid not working
Datagrid not working  The code here is working fine, apart from... the datagrid tag gives an error saying that the items attribute does not accept ant... This works fine for datagrid but then the javascript for drop down menu stops
ArrayCollection in DataGrid
ArrayCollection in DataGrid  Hi.... I want to know about What are the advantages of using arraycollection as a dataprovider instead of array in DataGrid? please give the ans ASAP....... Thanks
jsp-datagrid
jsp-datagrid  hello sir.....i have 20 records in my database and i am showing those data in datagrid view but now i want to show 10 data in one page... option in my datagrid view with 1,2 pages....plz help me...awaiting for your
jsp-datagrid
jsp-datagrid  hello sir.....i have 20 records in my database and i am showing those data in datagrid view but now i want to show 10 data in one page... option in my datagrid view with 1,2 pages....plz help me...awaiting for your
editable datagrid
editable datagrid  How to create a editable datagrid in jsp,struts1.3,glassfish v2.x application server and database oracle using netbeans6.8 ide?   Hi Friend, Please visit the following link: http://www.roseindia.net
jsp-datagrid
jsp-datagrid  hello sir...i have one view page in which edit and delete option are there in a datagrid view and i want to show data in page wise(pagination)...with previous and next links....i am also attaching my code for your
jsp-datagrid
jsp-datagrid  hello sir...i have one view page in which edit and delete option are there in a datagrid view and i want to show data in page wise(pagination)...with previous and next links....i am also attaching my code for your
Flex difference
2. flex ajax bridge 3. Two newly added component Advanced datagrid and OLAP dataGrid 4. Flex component kit for flash CS3 5. cross-domain facility 6. Added...Flex difference  Hi.... please tell me about What
jsp-datagrid
jsp-datagrid  hello sir...i have one view page in which edit and delete option are there in a datagrid view and i want to show data in page wise(pagination)...with previous and next links....i am also attaching my code for your
ComboBox ItemRenderer in DataGrid
combo box itemtenderer in the flex datagrid? please give me an example...://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex...; <mx:DataGrid id="myDG" dataProvider="{myDP
datagrid including combobox
datagrid including combobox  please send datagrid in jsp using mysql database based on id in the datagrid select each record and also update record with available to old values updation is done in form wise. using combo box
Datagrid in JSP - JSP-Servlet
Datagrid in JSP  I Want to display some record in datagrid of JSP page. I am using Apache tomcat server. please help me.  Hi Friend, Please visit the following code: http://www.roseindia.net/jsp/data-grid.shtml
datagrid in JSP - JSP-Servlet
datagrid in JSP  sir i want code t create a datagrid view in JSP. I am using oracle 10g. please help me.  Hi Friend, Please visit the following code: http://www.roseindia.net/jsp/data-grid.shtml Hope
DataGrid Control in Flex4
DataGrid control in Flex4: The DataGrid control is a MX component. There is no spark component. DataGrid Control is like a Table in html. The DataGrid.... It supports for paging. You can use ArrayList or AvtionScript for creating a DataGrid
datagrid search - Hibernate
datagrid search  Hi friend, i have displayed a datagrid using jsp but i need a search option in that which is used to display and sort it in a alphabetical order.... pls help me... Thanks in advance...   
DataGrid without DataBase
DataGrid without DataBase  I want display list of data without using database. Ex- Employee have some elements like- name, sex, place, designation. I have to display the content of these elements but without having
How to get data datagrid ?
How to get data datagrid ?  How to get data datagrid in jsp from arrayList in java? Code in java CategoryDao dao = new CategoryDao(); ArrayList<Categories> lstCategory = new ArrayList<Categories>
Flex ClassFactory
Flex ClassFactory   Hi.... What is ClassFactory and why...;factory object" which Flex uses to generate instances of another class... of a DataGrid control. When we change the item renderer at run time then we have to need
Flex Looping
Flex Looping  I need example for flex looping mechanisam example
Advertisements
 

 

 

DMCA.com