Flex :: Sorting - 4.5 Spark Datagrid Multi-column Sort?
May 9, 2011does anyboy know if Flex 4.5 Spark Datagrid suppoprts multi-column sort natively - just like the ADG does?
View 2 Repliesdoes anyboy know if Flex 4.5 Spark Datagrid suppoprts multi-column sort natively - just like the ADG does?
View 2 RepliesI have a spark DataGrid component with several columns and I want to have my application default to descending order on the first column in the DataGrid. I would like to use the built-in default sort that occurs when clicking the top header once. I have no need to sort the ArrayCollection I'm working with or change what the comparators are.I also want any user-generated sorting such as clicking on a different column's header to override the default sorting.
View 1 RepliesHow can you display a multi-line column header using the Flex Spark Data Grid for Flex 4.5?
View 5 RepliesI need to to a programmatic multi column sorting on the AdvancedDataGrid.The issue is, currently I am implementing paging on my grid. So, if I sort the data,only the perticular page is being sorted. So,I need to sort the entire list by the column criteria.I tried HeaderRelease event,but I guess it is of no use as I need to make a round trip call to the server to get the sorted data.Is there any way I can implement that.I also need to show the sort markers in the Column headers' right position, indicating the sort numbers and direction.
View 7 RepliesI'm trying to sort ArrayCollection with following dates, and getting unexpected results.
14-Apr-1980
01-Feb-1975
30-Dec-1977
27-Oct-1968
[Code]...
I'm creating a table that displays information from a MySQL database, I'm using foreignkeys all over the place to cross-reference data.
Basically I have a datagrid with a column named 'system.' The system is an int that represents the id of an object in another table. I've used lableFunction to cross-reference the two and rename the column. But now sorting doesn't work, I understand that you have to create a custom sorting function. I have tried cross-referencing the two tables again, but that takes ~30sec to sort 1200 rows. Now I'm just clueless as to what I should try next.
Is there any way to access the columns field label inside the sort function?
public function order(a:Object,b:Object):int
{
var v1:String = a.sys;
[Code]....
How to sort date column in datagrid with date format of 'DD/MM/YY'.
View 1 RepliesHow can I make my datagrid have its first column fixed and scroll the reset horizontally and vertically?
View 1 RepliesI'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.
I have a spark datagrid with selectionMode="multipleRows".
I have three columns in the datagrid. I don't want the row selection to happen when the user's click falls on the third column of a row.
The row selection should happen only when one of the first two columns is clicked. How do I achieve this? There is a selectionChanging event for the datagrid, but the GridSelectionEvent object received in the handler does not seem to provide any information about the column on which the click happened.
What is the event that gets fired when you click on a datagrid column to sort it? I could use that to know which column is getting sorted and hence have a common sortcomparefunction for all columns.
View 2 RepliesI 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]....
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.
Here are the strings this array can contain (in the correct order):
'recipients,' 'columnSelector,' 'headerImageLink,' 'title,' 'mainText,' 'text,' 'bodyImage'
Now, to sort them, I obviously don't want to do something like this:
if( a == 'columnSelector' && b == 'headerImageLink' ) return -1;
else if( a == 'columnSelector' && b == 'title' ) return -1;
else if( a == 'columnSelector' && b == 'mainText' ) return -1;
So that brings up an interesting thing. I know you can optimize the above some using something like this:
if( a == 'columnSelector' || a == 'bodyImage' ) return -1;
This would get the last two, but lately I have just wanted community input on issues I have had in the past. So the question is, what is the best way to write a custom sort, using a relatively random order (not alphabetical, etc)?
What is the best way to make a multi column form in Flex?My current solution if more than one column is required is to put the form items inside an <s:HGroup> but the alignment isn't the best.
View 2 RepliesI have created a Viewstack and using a Tile component and repeating LinkButtons I was able to make a multi column navigation with the viewstack as the dataprovider. My question is can this be done better? My code is below and I am wondering if I took the long way around this approach.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
[Code].....
How to make a table in Flash and enable the column headers on the table to sort column on click?I have seen some tutorials with mySQL but I'd like to start with something basic. Is a sortable table possible using just Flash and AS 2.0?
View 1 RepliesI have a column with 4 fields named : a> Main, b> Forward c> Back d> Link, if I use pre-defined sorting of datagrid with the column names which will be alphabetically, then the order is c>Back b>Forward d> Link a> Main. But, I do not want to sort based on the alphabets. I prefer to sort by names of the column fields. i.e. somehow give priority to each individual column field names. Like pre-define my own order.
View 2 RepliesI have a datagrid with data like this:
[Code]...
I have a Advanced Datagrid with sorting. I think it is string sorting by default. But i need the sorting in number. How can i achieve the number sorting.for example: i have row numbers like 1 to 100 . i need number sorting like 1,10,100.
View 2 RepliesThe datagrid gets its data from a back end database which has records like
[Code]....
I get errors like 1061: Call to a possibly undefined method refresh through a reference with static type mx.controls:DataGrid. for myRecords.refresh(); and Access of possibly undefined property sort through a reference with static type mx.controls:DataGrid. for myRecords.sort
I have several datagrids with changing columns. For the text fields the datagrid's sort function neems to be making a case sensitive compare. eg. the following list sorted would look like this apples strawberries Autos Autos should be with apples but since the capital A is counted differently all capital letters come after. I've found a lot of information on setting a CASEINSENSITIVE flag, but I can't figure out where to do this. The best solution would be one where I can override the default behavior to be case insensitive for all my datagrids and all my compare functions.
View 3 Repliesdg.selectedItems gives me all the values selected, but if i need one column names value alone then what should i do.
<mx:DataGridColumn dataField="1" headerText="Email" />
In my flex app I store the widths and visiblility of columns in an xml file. When the app loads it reads from the xml file and sets he columns values as applicable:
for(i = 0; i < columnsOrder.length; i++){
newOrder[i] = myDG.columns[Number(columnsOrder[i]) - 1];
newOrder[i].visible = (Number(columnsVisiblity[i]) == 1);
[code]....
In a flex datagrid, by default clicking on column headers does sorting. I want it such that if a user clicks a column header the entire column is selected. I have the datagrid listening for the HEADER_RELEASE event so I know when the column header is clicked.
How can I have the column and header appear highlighted similar to how a row is highlighted when selected?
I want to get all values in one of the columns of a datagrid and put them in an array, to use it as a dataprovider of a combobox, is this possible?
I use an ArrayCollection as the dataprovider of the datagrid, it's filled from the database.
Context: I have a data grid where the following has been implemented. tabbing through each column in a single row and creating a new row when tabbing from the last column. The last column in my datagrid is now a checkbox. I set the 'editable' to false as shown below (since we don't want editable text to be shown when user clicks on/tabs to checkbox.
Problem: When I tab through the columns of a given row, I cannot tab to the checkbox column and therefore cannot use the space bar to toggle between checked/unchecked. The user is forced to use the mouse to toggle the check box. Question: How do I let user tab to the checkbox column, and press spacebar to toggle between checked and unchecked?
How to highlight the data grid column?
View 1 RepliesWe have a Datagrid:[code]where practiceJoinRequestThicks is an ArrayCollection of PracticeJoinRequestThick object.The PracticeJoinRequestThick has an Practice Object.Practice has an arraycollection "PracticeContactAddresses" which is an arraycollection of PracticeContactAddress object and Practice ContactAddress object has Address object which has the field city:String.Now when I try to display the City, it does not work.
View 2 RepliesI have defined the datagrid as followsmx:DataGrid id="dg" width="100%" height="100%" >n the part i am trying to get the details from the database and setting the dataProvider for the DataGrid as follows.
var arrayContent:ArrayCollection = new ArrayCollection();
for(var i:int=0;i<assetClassDetails.length;i++)
{
[code]....