ActionScript 2.0 :: Datagrid : Show Clickable Cell?
Sep 26, 2011
I've created many grids and understand how to respond to a clicked cell but what I'd like to do is give the user a cue about which cells are clickable. An ideal solution would be for the cursor to react as it does for a button and turn into a pointing finger.
I can successfully add a validator on an item in my datagrid, by passing in the particular element in the dataProvider to the validator, but I can't get the red border to show up around the cell if the validation fails. I have stepped through the validator, and confirmed that it is passing back a failure, but I can't figure out why the red error border doesn't show up. I have a feeling its because I am passing the item in my dataProvider as the validator source, rather than the 'cell' item, but I can't find a way to access the cell.
I am working on a problem since a week soon, but I still couldn't make it work as expected. I have a DataGrid which has HBox with a CheckBox an a Label as itemRenderer (see Code below). When I tap in to the Cell the standard itemEditor pops up and lets you enter the content of the label. Thats the standard behavior. I works fine except for 2 problems:
If I enter to much text, the horizontal srollbar pops up, and the cell is filled with that scrollbar. As you see I tried to set the horizontalScrollPolicy to off, but that doesnt work at all... I tried to do that for all the different elements, but the failure is still existent. When I have filled more than one row, there is an other mistake happening. If I tap on a row, the datagrid selects the one below that row. That's only if one line is already selected. If I tap outside the datagrid and then, tap at any row the itemEditor of the right row will show up... Is there anything now wright in the setup of my set data method?
I am using a datagrid in flex and need to render each cell with a different style.What could be the best way to set a style to a perticular cell in datagrid/advanced datagrid (flex)?
I think one possible option can be extend the datagrid and override the drawRowBackgroungd function. Apart from this can i use some custom item renderer or some property similar to label function of a series, there it used to return label here we need a style.
I have created a datagrid with 2 columns. The first one is the normal text data and the second column contains buttons for each cell. What I want to do is retrieve the text information when the corresponding button on the same row is clicked. How do I get this information? I am unable to use selectedItem because I do not want to select the correct row before pressing the button.
Have tried to figure out how this can be done - use this simple code to populate a datagrid with XML data in this format. What i want is a datagrid that will function as a gantt chart - with 2 different colors - just thought this might be a way to solve it. In the final XML there will be more than the 2 columns!
I am using Flash CS3 datagrid component, I want to show more than one image in the same cell.I m using LoadCellRenderer class extends UILoader implements ICellRenderer,but it loads only one image in cell.
I have an editable datagrid with a dataprovider which is basically Numbers. Is it possible to delete a value? When I do it it puts a 0 in that cell but I really need an empty value, like a Null or a NaN whose are going to be cleaned later with a labelFunction. BTW I also need the cells to keep the 0 if needed to.
For a long while now (way too long) I've being searching fora decent example for using components such as a checkbox orcombobox inside of a datagrid.The only examples that i could find where all AS2 examples.The closest thing I find to an AS3 example for adding checkboxes,buttons etc to a datagrid was here but it is in no way clear how to alter the example for othercomponents.
I'm working on simulating a diagnostic tool and I'm using a dataGrid as part of the sim. I'm populating the dataGrid with an xml file. It loads and runs fine.I need to change the values of the dataGrid cells when the user presses the buttons. For example, if a cell row 0, column 0 has a value of 51, it needs to change to 45-88 when the user presses a button.
I want to update a single cell value in a datagrid, is this possible?here is the code from adobe for replaceItemAt example:
my_dg.setSize(140, 100);my_dg.move(10, 40);replace_button.move(10, 10);// Set up sample data.var myDP_array:Array = new Array();myDP_array.push({name:"Clark", score:3135});myDP_array.push({name:"Bruce",
I have a Flex DataGrid, which has some columns, i had put a item renderer, which makes all the elements in that column hyperlinked, i have a requirement, where i need to see the type of user, based on that i have to either enable or disable the hyper link.
Is there any good way , where i can get the style properties at the cell level...?
I want to select information in a single cell from my DataGrid in Flex 3.
Specifically, I'm displaying three phone numbers per line and the user needs to be able to select one of those numbers, from any row, but not the whole row.
While similar to this, I am displaying the DataGrid to the user. The answer for that question was to manipulate the dataProvider, how can I know what cell I've selected in order to do that?
I have an AdvancedDataGrid that loads data from a web service. It only loads the top level stuff and then as you click the arrows it gets that data. All I want to do is to find out if some text is in one of the cells. I originally did this:
public static function assertTextInAdg(params:Object):Boolean{ // Gets the ADG trace('youre in the assertTextInAdg function'); var grid:* = FPLocator.lookupDisplayObject(params); trace('var grid:* = FPLocator.lookupDisplayObject(params): ' + grid); [Code] .....
And then it fails, because it can't get the source, I think. I am completely open to other strategies and I have been stuck on this problem for 10 days now. This seems like it would be relatively easy. I have been going down a slightly different route. I am now trying to iterate through the HierarchicalCollectionView with a cursor. This seems to work. But, when I get the node I can't do anything useful with it... I have been looking for examples but so far they all stop at the point of getting the node.
public static function assertTextInAdg(params:Object):Boolean{ // Gets the ADG trace('youre in the assertTextInAdg function'); var grid:* = FPLocator.lookupDisplayObject(params); trace('var grid:* = FPLocator.lookupDisplayObject(params): ' + grid); [Code] .....
I am creating Flex application.When enter data in data grid cell that time i want to check that cell value is less then 20 and if it not then change that cell's back color to red.
1) Using the MouseEvent.CLICK listener, I can determine the row (and all of the values in that row) that was clicked, but I can't seem to figure out how to tell what column the clicked cell is in.
2) Is it possible (and if so, how) to assign a textFormat (or style) to just one column in a DataGrid?
Code: //import fl.events.ListEvent myDataGrid.addEventListener(ListEvent.ITEM_CLICK, clickHandler); function clickHandler(e:ListEvent):void
[Code]....
When I run this I get an error on the first click and any next click on a row will give me the cell data of the previous click (so I'm one step behind).
What should I do to get the data from the cell to show up in my text field?
Here's a question for you. I have a dataGrid that I want to be able to edit only when the user clicks on a particular button. When this happens, I make the dataGrid editable and I make that particular column editable. After the user modifies the cell's content and hits ENTER, I want the edit cell to close and the dataGrid to once again become non editable. Here's the code in my Key.onKeyUp listeneif(Key.getCode() == Key.ESCAPE || Key.getCode() == Key.ENTER){ my_dg.getColumnAt(2).editable = false; my_dg.editable = false;}If the user hits ESC, the edit box closes correctly. If he hits the ENTER key, the edit box remains visible until he hits ENTER once more. Only then does it disappear
I'm trying to render a Flex datagrid using an external XML datasource. Is there a way I can specify in the XML that a cell element should appear as a hyperlink?