Posts

Showing posts with the label dataGrid

Flex DataGrid sorts

Sometimes your data is in a specific order, but not ordered on anything you can really sort by via a data grid. So sometimes you apply a sort with the data grid (or advanced data grid), which is great and everything, but what do you do when you want to reset the data back to the original order? this.mydatagrid.dataProvider.sort = null; this.mydatagrid.dataProvider.refresh(); Done!

Flex Datagrids and datatips

So you think when you set the showDataTips property on the DataGridColumn to true that that will make the datatip show... WRONG... you also need to set the dataTipField property to your dataField. So simple... yet this took me half an hour to figure out.

Flex Checkbox as Grid item editor and renderer

I have a dataGrid with a few columns that are simply check boxes. The kicker is I want the user to be able to edit those check boxes. So I knew the first step, using the renderer to have the data from the data provider show up in a check box, but I had to do some research for the editor part. Here is the code snip of the DataGridColumn that should help you out if you were trying to do that same thing. (Warning: the textAlign property may only work in Flex 3). <mx:DataGridColumn dataField="isOpen" headerText="Open" editable="true" textAlign="center" itemEditor="mx.controls.CheckBox" editorDataField="selected" itemRenderer="mx.controls.CheckBox"/> The important part to this that I was missing is: editorDataField="selected" This returns the value of the 'selected' property to the data provider, otherwise, by default it looks to return the "text" property, which a ch...