Xml :: DataGrid ItemRenderer Error - Button Appear Only On Certain Rows Of The Column

Aug 25, 2011

I am populating 3 columns of my datagrid using a simple XML file. The last column is supposed to be an itemrenderer, basically a Button. However the button should appear only on certain rows of the 3rd column of the datagrid depending on the value from the XML file, which is either "true" or "false". So basically I want to set the Visible property of the button in the itemrenderer to true or false.

[Code]...

View 2 Replies


Similar Posts:


Flex :: Getting Error When Use Itemrenderer And Itemeditor Components In The Datagrid Column

Apr 11, 2011

[Code]...

ErrorStackTrace: ReferenceError: Error #1069: Property text not found on a.mxml.a_inlineComponent3 and there is no default value.

View 2 Replies

Flex :: Transposing Set Of Rows As Column In DataGrid

Aug 26, 2009

I have an array like the following one
public var sal:Array=[
{empNo:1001, sal:1000, exp:400},
{empNo:1002, sal:3000, exp:240},
{empNo:1003, sal:1000, exp:452},
{empNo:1004, sal:5000, exp:348},
......
{empNo:1550, sal:2000, exp:330},
];

I need to show data using a 3 row flex data grid where the first row will display empNo, the second row will display corresponding salary(field sal), and the third row will display Expenditure (field exp).

View 2 Replies

Actionscript 3 :: Show ItemRenderer In Specific DataGrid Rows?

Dec 23, 2009

I have a DataGrid populated via an Array. The last column in the DataGrid uses an ItemRenderer (Button). I want to show the Button in certain rows but not in others (leave those empty). I've looked everywhere for an example or even a clue how to do this (tried labelFunction on DG, etc.) but can't find anything about it.

View 3 Replies

Flex :: Validate Certain DataGrid Rows Made With ItemRenderer?

Jun 15, 2011

I have a DataGrid which uses an itemRenderer to display the items in a DataGridColumn. The ItemRenderer is created in actionscript and contains the following code:

public class PromptingColumnRenderer extends Label {
public function PromptingColumnRenderer()
{

[Code].....

In this DataGrid column, I require number validation on only the data with the type="NUMBER" field set. The problem is, when I try to declare a NumberValidator within my PromptingColumnRenderer actionscript code, the view recycles the renderer, and the NumberValidator attempts to validate non-numeric rows. What is the best way to validate only the rows with the type="NUMBER" field set?

View 1 Replies

Flex :: Drag And Drop Rows Using Only The First Column Of The DataGrid?

May 2, 2011

I need to allow drag and drop in my DataGrid, but I have a lot of item renderer and item editor that makes conflicts with events when dragging.

So, I want to restrict the activation of drag and drop in the first column ?

View 1 Replies

Flex :: Creating Multiple ItemRenderer For DataGrid Column

Aug 25, 2009

I actually wanted to create an itemrenderer which will contain below code :
<mx:HBox xmlns:mx="[URL]" width="0" height="0" >
<mx:Label text="{data.xval}" />
<mx:Spacer width="100%" />
<mx:Image source="edit.gif" width="16" toolTip="Edit" />
</mx:HBox>

Now when I click on the image datgrid column should be editable, for that I am using a textinput as an itemeditor. Now I also want to highlight all those cell for this datagrid column which are having data more than 8 characters. I am able to do this separately using 2 different itemrenderers. But I want to get this all together. Can we have multiple itemrenderer for any datagrid column?

View 1 Replies

Flex :: ItemRenderer Doesn't Resize With DataGrid Column

Mar 7, 2012

I have an item renderer tied to an mx:DataGrid column. The renderer used to be inline with the column, but I've moved it out to its own file so I can reuse it across multiple tables.

The problem is that now the renderer doesn't resize (grow/shrink) when the column is resized. So if the user makes the column very small, the contents displayed by the renderer just eat up space and show up over top other columns

Code for Item Renderer:

<?xml version="1.0" encoding="utf-8"?>
<s:MXDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"

[Code].....

View 1 Replies

Actionscript 3 :: Get Column Index In Custom Itemrenderer For Spark Datagrid

Jan 16, 2012

I am trying to use the same custom renderer for all the columns in a spark DataGrid. I need to know the dataField or columnIndex based on which I can change state in my custom itemrenderer.

Earlier in mx:DataGrid, this can be achieved by extending the MXDataGridItemRenderer which implements IDropInListItemRenderer and hence dataGridListData property is available.

But using the spark DataGrid, I am extending the GridItemRenderer which DOES NOT implement the IDropInListItemRenderer and hence unable to access dataGridListData property. I have tried to write an action script class extending GridItemRenderer and implementing dataGridListData but flex throws an error in the set function of this variable.

// Sample itemRenderer used for mx:DataGrid [Working Code]
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;

[Code]....

View 1 Replies

Actionscript 3 :: Limit Flex Spark DataGrid ItemRenderer Data To Column

Feb 27, 2012

I've got a DataGrid in my mobile application (I know, I know but there's currently not other solution for this), that numeric values. Depending on the value of a cell, the text gets colored. My big issue is that this doesn't work very for more than about 5 rows of data. I reckon the issue is that the set text function (in which I format the color) can't keep up with the amount of cell changes and formats the text based on the last updated cell of the row.I thought about a column item renderer so that the renderer only gets the value for that column, and not the whole data of the row.

Just for reference, this is my current item renderer (again, this works fine for few rows, for 5+ of fast changing data, this doesn't work any more, cells get formatted even though their data hasn't changed).[code]I just double-checked and have to revert my previous statement. A single row works fine, the second row already messes up the color formatting though. It seems as if the datagrid somehow throws together the values.
Doing the color formatting in the set data method shows the exact same effect;[code]My assumption about the grid messing up the ItemRenderer's data seems to be correct.A simple trace in the set data method (trace("old: " + _oldVal + "new : " + value[column.dataField]);) revealed that somehow, values of the next grid row (in case there are 2) get used as well as _oldVal gets the old value of the next row.

View 1 Replies

Flex :: Know When A Button In DataGrid ItemRenderer Is Clicked?

Jul 8, 2009

I have a DataGrid component that displays a few columns of data. It has one additional column that displays a Button that allows the user to take an action with regard to the record. [code]...

View 2 Replies

Actionscript :: Flex DataGrid Add Button In Datagridcolumn Using ItemRenderer?

May 12, 2011

I have this code. I want to add Buttons in the second column of the data grird.

[Code]....

How can I add buttons in second column using an ItemRenderer?

View 1 Replies

Flex :: Flash - DataGrid Column Width: One Column To Rule Them All?

Nov 16, 2010

I have a Flex 4, mx:DataGrid with the following (pertinent) properties set:

width="100%"horizontalScrollPolicy="off"

I have the minWidth set on all of the DataGridColumns and the width set on one of them. If I simply maximize/minimize the display (in browser or stand-alone flash player) of the application, the columns scale up and down nicely. But if you grab the edge of the application and drag it to make it bigger, only one column grows really big. When you drag the size down again, the one column remains big, but all of the other columns get squished way down.

View 3 Replies

Actionscript 3 :: Add Spacing Around A Flex DataGrid Drop-in Button ItemRenderer?

Jul 8, 2009

I have a DataGrid with an drop-in Button itemRenderer:

[Code]...

However, the button extends all the way both the right and left edge of the DataGridColumn. I've tried messing with the width properties and paddingLeft and paddingRight styles of both the DataGridColumn and the itemRenderer, but nothing seems to work. NOTE: I do not want to use a Container or UIComponent with the Button as a child as the itemRenderer - too much code.

View 2 Replies

Flex :: Deleting Row Of Datagrid By Clicking A Button Part Of That Row In Delete Column?

Nov 23, 2010

I want to delete a row of my datagrid when someone click a button part of that row located below Delete Column. I tried many different way one of those were to

<mx:DataGrid id="userGrid" dataProvider="{userGridData}" width="800" height="500" itemClick="userGrid_itemClickHandler(event)" creationComplete="userGrid_creationCompleteHandler(event)">
<mx:columns>

[Code].....

The item render ev.renderers.UserGridEditRender has a delete button listing for click event it basically do userGridData.removeItemAt(userGrid.selectedIndex);
(UserGridData = Data provider of grid with id "userGrid") But whenever I click the button an exception is throw

RangeError: Index '-1' specified is out of bounds.

View 1 Replies

Flex 4 List ItemRenderer - Different Itemrenderers For Different Rows?

Jun 28, 2010

I'm creating a list of scores for a game. now most of the list i need to have the same ItemRenderer. but in one specific row of the list where the user who's playing is listed, it should show different information and with different background color. how can i achieve this ?

I already tried to resolve the issue with states, i created 2 states, one state called 'mine' and the 2nd state called 'others'.

the problems that i got is that when users click on one of the list rows that state changes to i donno clicked or something and that's why i assumed that states are not the right action for me.

View 3 Replies

Actionscript 3 :: Datagrid Freeze Pane / Always Show Column In Scrollable Datagrid

Feb 28, 2012

I have a datagrid with some custom renderrers and I'm just curious how I should approach the ability to freeze and always show the left 3 most columns at all times when scrolling left/right.

I thought that I might have to resort to 2 datagrids, side-by-side, the first showing the 3 columns that I want at all times, and the ability to scroll the rest. Only issue then I guess is linking the row selection to select that row in both and to tie the column sorts together...

Or would it be better to try and take columns 4+ and shrink their width to 0 as a person scrolls right, and then increase it back to the max width as they scroll left? Though that would cause funny issues to happen as the content of the datagrid would get smaller and smaller until you were 100% to the right and the scrollbar would disappear.

View 1 Replies

Flex :: Improve Datagrid Performance When Using Itemrenderer With In Datagrid?

Jul 31, 2009

For poor performance reasons, the DataGrid will cache checkboxes and reuse them for different rows. If you have 50 rows, it won't create 50 checkboxes. It will create as many checkboxes at are visible, plus a few more for padding, and then reuse them as you scroll. This is why you need to explicitly manage their state. How can improve it ? How can fixed checkbox value ? i used checkbox like below But checkbox doesnot remembering the values

[Code]...

View 3 Replies

Flex :: Remove Button In ItemRenderer Giving Error

Jun 20, 2011

I am using the following .as file as the component for an itemrenderer in a list. Basically each item is rendered in a TextInput and each TextInput has a remove button as you can see from the code. When clicking the remove button, I want to remove the selectedItem..so I am putting the function removeItem() in MainMxml.xml and calling it from the .as file.

However I am getting an error "Cannot access a method or property of a null object reference".

The .as file as follows:

package components {
import flash.events.Event;
import flash.events.MouseEvent;

[Code]...

View 1 Replies

Flex :: Calculate The Sum Of A Datagrid's Rows?

Jun 6, 2010

I have this datagrid which has columns with a NumericStepper as an itemEditor where the user can change the number of items he wants to buy. How can I calculate the sum of all cells when the user updates datagrid's values?

EDIT 1

My datagrid is about colors and sizes of a product. The columns are generated dynamically from this function

private function getColumn(dataField:String, headerText:String,editable:Boolean) : DataGridColumn
{
var column:DataGridColumn = new DataGridColumn(dataField);

[Code]....

the row.size28 is generated dynamically. So it could be row.size29,row.size30 etc.

How can I loop through all my cells without knowing their data.property?

View 1 Replies

Flex :: Order Of Rows In A Datagrid?

Jun 26, 2010

I have a datagrid and it lists several rows as

seqno | NAME | COMPANY
1 | BOB | D&T
2 | Jenny | M&Y
3 | Jane | D&T

It is possible to have buttons as [MOVE UP] and [MOVE DOWN] so that when I select a row in a datagrid and press one of those button that the order changes and the seqno updates accordingly.

Meaning if I select Jane and press the [MOVE UP] button, the new order would be;

seqno | NAME | COMPANY
1 | BOB | D&T
2 | Jane | D&T
3 | Jenny | M&Y

View 2 Replies

Flex :: Limit Rows Of Datagrid In It?

Jul 26, 2011

I have a data grid consisting of 3 columns & many rows, i want to show only the first 20 rows to user. Is there any way i can show only the first 20 rows in my datagrid.After by clicking button 'next', next 20 rows should display and so on...

View 1 Replies

Flex :: Numbered Rows In Datagrid?

Aug 31, 2011

I am creating an app where users input their investment info into a datagrid on each row one row at a time. As they move along new rows are dynamically generated so they can input new investments. As the user moves and puts in new info I want a column to display what row the user is on (or better said what number investment he is on). how to create the function:

private function rowCount():void
{
myDG.dataProvider=tasks;

[Code]....

View 1 Replies

Flash :: Delete All Rows In A DataGrid?

Dec 28, 2011

I need to delete all existing rows from a data grid, i have tried using this but doesn't work[code]...

View 3 Replies

ActionScript 2.0 :: Add Or Remove Rows To A Datagrid?

Nov 23, 2008

which is great because it shows how to add columns to a datagrid, but how do you add and remove rows to the datagrid?I'm trying to I'm trying to come up with a Character Generator for our Tabletop Wargame (see hereand rows to appear when you say click on a Weapon like Fist and then onto another weapon (Fist only works atm as a demo).ie how could i format it so it was like a table (because at the moment the Fist stats are formatted with spacebar spaces), and how could i make it so that when you choose your 1st weapon it appears 1st in the table (say a Bow), and when you click your 2nd weapon it appears 2nd in the table (say a Sword), etc...

View 8 Replies

Flex :: Swapping Columns And Rows Of DataGrid Possible?

Jul 22, 2009

I have a 1 row, many column flex datagrid. I would like to turn the dataGrid on its side, so that the column headers become a single column running down and v.v. Is there a way to do that in the DataGrid? Or am I stuck manipulating the data presented to the grid?

I have an object like:
x=y
b=u
o=p
u=e
w=p

And I'd like a control that is visually similar to that. Currently the datagrid displays the object as:
x b o u w
y u p e p
Which is too horizontal for my case.

View 2 Replies

Flex :: DataGrid - Allow Headers For Different Groups Of Rows

Oct 27, 2009

I am trying to extend the DataGrid to allow headers for different groups of rows. However, I cannot figure out which method to extend from DataGrid that would allow me to accomplish this. I do not want the headers to be included in the dataProvider, only the rows. I want to specify indexes to insert the headers at using a property of the custom datagrid.
Here is a quick photoshop showing what I am trying to do:
Is there any custom component already built that will do this?

View 2 Replies

Php :: Displaying Rows - Extracted From A Database - One By One In A DataGrid

Oct 29, 2009

I have a table (session) in a database which has almost 72,000 rows. I extract those rows with the help php+mysql but when the result is returned to the HTTPService, i need to wait for some 32 seconds before the all the rows start appearing in the DataGrid at once.

Question Is there any way by which DataGrid may start displaying data one by one while the application may extract next rows in parallel. Or that the DataGrid may show data in chunks of hundreds. Like when application starts, it may show first 400 enteries in DataGrid, then the next 400 hundred are extracted until all the 72,000 rows are extracted? Or can i involve threading such that one thread may be responsible for displaying data in datagrid while the other, executing in parallel may be responsible for extracting next data from database?

[Code]....

View 1 Replies

Flex :: Show Row Index For DataGrid Rows?

Nov 24, 2009

Is it possible to dynamically show row index for DataGrid rows ?

I have a static ArrayCollection which is set to be DataGrid's data provider and I would like to always have row numbering for each populated row (e.g. in a column called "#").

View 1 Replies

Flex :: DataGrid - How To Color Empy Rows

Jan 4, 2010

My problem is that empy rows (if there are more rows that dataSource items then there are empy rows) look identical to rows binded to dataSource items which are empy (see the difference?). The only way to know the difference is to hover over them with the mouse, and if they are empty there's no color change, otherwise there's the blue background of the selection.. I want to change the color or in some way hide empty rows, those that are not bound to a dataSource item.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved