Sort order incorrect in datagrid sort multiple columns

Hello

I'm a little confused about sort multiple columns in a datagrid. The following code sorts, but not the sort, I expect or what you are doing the thing about a coming O alphabetically before or after P. In my opinion, the code must sort stadt, vname by clicking on the city column, and name, the VNAME by clicking on the column name, but obviously he disobeys correctly? You see an error in the code or is this a bug?

<? XML version = "1.0" encoding = "utf-8"? >
"" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml ' layout = "vertical" >
< mx:Script >
<! [CDATA]
Import mx.collections.SortField;
Import mx.collections.Sort;
Import mx.collections.ArrayCollection;
Import mx.events.DataGridEvent;
var myData: ArrayCollection collection = new ArrayCollection (new Array () collection
{name: "Meier", vname: "Peter", City: "Bonn"},
{name: "Meier", vname: "Max", City: "Bonn"},
{name: "Meier", vname: "Olga", City: "Bonn"},
{name: "Meier", vname: "Peter", City: "Bochum"},
{name: "Meier", vname: "Susi", City: "Bochum"}
));
function mySort(event:DataGridEvent) {}
var mySorter: sort = new Sort();
Switch (event.columnIndex) {}
case 1:
mySorter.fields =]
new SortField ("name", true),
new SortField ("vname", true)
];
break;
case 3:
mySorter.fields =]
new SortField ("stadt", true),
new SortField ("name", true),
new SortField ("vname", true)
];
break;
}
myData.sort = mySorter;
myData.refresh ();
}
[]] >
< / mx:Script >
< mx:DataGrid dataProvider = '{myData}' headerRelease = "mySort (event)" >
< mx:columns >
< mx:DataGridColumn dataField = "name" headerText = "Name" / >
< mx:DataGridColumn dataField = "VNAME" headerText = "Vorname" sortable = "false" / >
< mx:DataGridColumn dataField = "stadt" headerText = "Stadt" / >
< / mx:columns >
< / mx:DataGrid >
< / mx:Application >

Allright! So the column index begins with zero don't step one! It was the first.

Secondly, once you have defined your own sorter, you don't want the default behavior of the event to pass by so you will add

Event.preventDefault ();

just after myData.refresh (); line.

Give it a shot. should work.

HTH.

ATTA

Tags: Flex

Similar Questions

  • OBIEE 11 g: sort by multiple columns

    We have recently updated to 11g of 10g. In 10g, you were able to sort a column and then put a secondary on another column sort, regardless of the first.

    So in 10g, you can view quarter and region, and by default are displayed by default, both are sorted in descending order:

    America Q1
    Europe Q1
    America Q2
    Europe Q2

    And I can then sort descent and the region shift down and see that both are sorted by descending order regardless of the other:

    Europe Q2
    America Q2

    Europe Q1
    America Q1

    11 g, however, if I sort the fourth descendant and then ranking descending from the region, neighborhood found upward and I get something like this:

    Europe Q1
    Europe Q2
    America Q1
    America Q2

    How can I get a similar feature off 11 g?

    Thanks for the help!

    Published by: 863307 on August 9, 2011 15:51

    Published by: 863307 on August 9, 2011 15:53

    You use the option to right click on the second column to sort after you apply sorting on the first column?

    Reference http://download.oracle.com/docs/cd/E21764_01/bi.1111/e10544/creatingviews.htm#BACICEDB

    Hope this is useful

  • Sort the columns dynamically built DataGrid...

    Hi people...
    usually, I'm building my DataGrid dynamically... with something like this:

    ... omissis...
    SQLstatement.text = "SELECT name, address FROM myDBTable";
    SQLstatement.execute ();
    resultSQL = SQLstatement.getResult ();
    MyArrayCollection.source = resultSQL.data;
    myDataGrid.dataProvider = MyArrayCollection;
    ... omissis...

    and it works perfectly... the problem is that resultSQL.data, by default, is a table sorted by "abc" (ehmmm... in English is alphabetical sorting?).
    Could, I want the same sort of my query, where the NAME came before the ADDRESS...

    Is there a solution?
    I don't want to pre-build a datagrid with all columns... because it cancels my dynamic datagrid features...

    Thanks for all help...
    bye bye ^ _ ^.

    Thanks for your advice ntsiii :))

    but now I use a SQLite database... so I prefer using Flex function...
    but I tried a solution (Pentecost of google of course help)

    the idea is the following:
    Once completed this datagrid, I copy dg.colums to a temporaney tempArray...
    can I swap the columns that are not in the right place... and in the end, I put dg.columns = tempArray...

    I tried this method time ago... but it did not work because I tried to change directly from db.columns [x]...

    Now, I'm convinced!

    Bye bye

  • Sort alphabetical column of numbers

    Hello

    I have a table that looks like this:

    I am trying to sort each column in alphabetical order (i.e. a separate for the column B, C etc.), but everything seems to be able to do is sort the entire table.

    Any help would be appreciated gratefully.

    Thank you very much

    Stophen.

    Hi Stophen,

    Numbers treats each line as a related data and keep lines together when you sort. If you had each column in a separate table you could sort independently.

    Quinn

  • Sort by column heading in reports

    Did someone havhing idea how to enable sorting by the columns header feature in reports.

    Thanks in advance
    ADI

    Published by: Adi on January 27, 2010 05:03

    Amit

    This is the definition of fair report > report attributes.

    At the top of the page will be the column attributes section that has a checkbox to activate sort each column and a sort sequence to specify the order of default sort (as using ORDER BY in the query).

    See you soon

    Ben

  • Sorting of columns in report with the invisible column...?

    Hello

    I have a sidecolumn + in a single report, which must be sorted as * 1, 1, 1 +, 2, 2, 2 + *.

    There is a second column invisible rating_order+ where I have the real sort order * 1,2,3,4,5,6 *.

    It is possible to sort the column visible rating+ with the sort link on the column header, but sorting through the invisible rating_order+ column...?

    Thank you

    Jürgen

    Jürgen

    Make the rating_order visible column. On the page "Column attributes" for this column under development shaped column, assign Expression HTML #RATING #.

    CITY

  • Sorting on columns with report based on a model - named column (model line)

    Hi forum,

    I'm trying to reproduce the column regularly a report feature in a report of 'Named column' sort.
    The column headings are in the region 'before lines' 'Before the first and after the last line text' model:
    <th onClick="sortByColumn('#REGION_ID#',5)">Frequency</th>
    citing this javascript:
    function sortByColumn(regionId,colNo) {
         var u = "f?p=124:401:&SESSION.:fsp_sort_" + colNo + "::RP&fsp_region_id="+regionId.substring(1);
           document.location.href=u;
    }
    I would like to sort descending when a user clicks on the column again and display the column sort arrows (up/down).
    However, given that the sorting is kept by the user, even if the page cache is disabled, it would be necessary pick up the sort column and order (ascending, descending) on the loading of the page or the query at a later time using ajax, so that the display type (arrows) remains synchronized with the actual sorting.

    Someone at - it an idea how to proceed?

    See you soon

    Published by: YT on April 1st, 2009 16:19

    Published by: YT on April 1st, 2009 16:24

    Published by: YT on April 1st, 2009 16:26

    Hello

    On the reports of sort order is stored as user preferences - see need to do the SORTING of columns only when I click on the column header for example of the Dene on how to use this

    Andy

  • This number is no longer a sort by column?

    This number is no longer a sort by column?

    Hi Casey,.

    Fix. Categories is not supported in this application of numbers.

    Experiment with sort & filter (in particular the filter). You can find a useful substitute.

    Kind regards

    Barry

  • I'm on the 4.1.1.00.23 Apex vesion. I've created a classic report and I am trying to sort. Here's how I'm trying to sort by column name. I have TotPGPV with sorting sequence 1 desc and NewTOTPGPV with sorting sequence 2 desc. I have Count1, Count5 with t

    I'm on version 4.1.1.00.23 of the APEX. I've created a classic report and I am trying to sort. Here's how I'm trying to sort by column name. I have TotPGPV with sorting sequence 1 desc and NewTOTPGPV with sorting sequence 2 desc. I have Count1, Count5 with the sort column. What I'm asking is when the report is run can column sorting to default Count1 and Count5 descending instead of the ascendant. I don't see anywhere to set the default value for the sort column.

    Hi - on the report of the page attributes - that you show in your attached screenshot - you can select the columns to sort on the sort sequence as well as the direction of the sort, i.e. for a given column, you can choose to allow sorting on this column, what position this column must be in the sort sequence and whether to sort Ascending or descending by default (i.e. '1' means sort this column first and bottom-up and "1 desc") sort this column first and downhill). Don't forget that once you click on one of the headings of column during execution, it changes your sort settings and these settings are stored in your preferences, that is, they are used again the next time you log in your application and rerun the report.

    Kind regards
    Marc

  • How to add sorting Date columns?

    Hi all

    I have to sort the column date OBIEE answers. I registered using the type of the sort option by clicking on edit option-> sorting-> sort object growing option. Even in this case sorting will not apply to the column. What could be the problem.

    Anyone please shed some light on this issue.

    Thanks in advance,
    Stephanie

    875991 wrote:
    Hi all

    I have to sort the column date OBIEE answers. I applied the sort by using the sort option by clicking on change of object-> sorting-> sorting option growing option. Even in this case sorting will not apply to the column. What could be the problem.

    Anyone please shed some light on this issue.

    Thanks in advance,
    Stephanie

    You are talking in a PivotTable? If Yes, then you do this:

    (1) duplicate the layer of data column and drag it all the way to the left.

    (2) apply the type of this column.

    (3) hide.

    In PivotTables, OBIEE sorts from left to right, whatever by clicking on the arrows to sort. To sort by a particular column, it must be further. If you want a secondary sort, to duplicate the layer of this column and move to second on the far left. Hide the columns so that you do not see the columns twice. Of course, if the column you want to sort by is already in the extreme is left, so no need to duplicate the layer. Simply apply the sort. Most people, however, that the sort to be elsewhere in the section column lines and that's why you need to duplicate the layer, sort and hide.

    I hope this is what you have been struggling with.

  • Problems with sorting of columns and the number of lines in the report

    Hello

    I'm having a problem with sorting of columns and the number of lines displayed in a report.

    This report displays the data correct, but if I try to sort on a column when I click on the column heading in the report returns no line... I need to click on the "go" button to refresh the report (with the column sorted now) in to display the data.

    Similarly, I display only 15 lines per page. If I try to view the lines 16-30, 31-45, etc., that it returns no line until I click on the 'go' button to refresh again.

    Has anyone else had (and overcome) the same problem?

    Thank you

    Joseph

    Joseph,

    2 questions:

    1) are you using the elements referenced by the report page to filter etc.. ? If so, you're failing values of these when the loading of the page?
    (2) are you using PPR page through the results?

    If so, it could be a problem with the different types of session state, as Anton Nielsen blogged about here:
    http://c2anton.blogspot.com/2008/12/Oracle-Application-Express-Apex-three.html

    If so, you can use calculations or processes to set element values in session state persistent during page rendering, as Anton mentions. In this way, when you use PPR page values will be available in session state and your report should work fine.

    Anthony.

  • Sorting the columns showing only a line

    Hello

    I have a report of sql query that I helped sort on all columns. When I click on the header to sort a column report shows only one line.
    If anyone can help me, I would really appreciate it!

    Thank you!

    Once I met a similar problem like the one you describe. I suspect that the problem was related to the data that the report was released.
    I was able to make the problem disappear by disabling "Partial Page Refresh" for the report. Define 'NO' for the attribute "Activate partial Refresh of Page" in the page 'Report attributes' disable PPR for the report.

    CITY

  • Concatenate multiple columns in a single string

    Hello

    I use Oracle 11.2, how can I concatenate values from multiple columns in a string with an SQL:

    create table testTb (number (5) classId, class varchar2 (32));

    Insert into the testTb value (101, 'room101');
    Insert into the testTb value (101, 'room201');
    Insert into the testTb value (101, 'room301');
    Insert into the testTb value (202, 'room444');
    Insert into the testTb value (202, 'room555');

    I would like to generate the result as following:

    Class 101 is room101, room201, room301
    202 class is located in room444, room555

    Thank you

    Please post sample data.
    11.2 you can use LISTAGG:

    SQL> select 'Class '||classid||' is in '||listagg(classroom, ', ') within group (order by classroom)
     str
      2  from   testtb
      3  group by classid;
    
    STR
    --------------------------------------------------------------------------------
    Class 101 is in room101, room201, room301
    Class 202 is in room444, room555
    
    2 rows selected.
    
    SQL> 
    
  • GROUP BY with multiple columns.

    I have a little query on the GROUP BY clause.

    Sometimes, we will give several names of columns in GROUP BY. If it behaves in the same way as ORDER BY (multi-column) I wish I had an example where I can use GROUP BY multiple columns. in any case regardless of his behaviour, it will be really appreciated if someone can explain a scenario where GROUP BY with multiple columns can be used.

    I know about the use of GROUP BY aggregate functions, but using a single column.

    Thank you.. !!!

    No, not like that

    I think that Group by does not follow any order...

    If we execute like this

    SELECT registrationid, dateofbirth, sum (age) FROM prawin62 WHERE registrationid = 22 GROUP BY dateofbirth, registrationid.

    22     1/23/1975     54
    22     5/18/2011     330
    

    It will give the same result based on date of birth...

    ~ Praveen

  • Gears - error when you try to insert values into a table with multiple columns

    Hello

    I started playing with the gears and SQlLite today and I get an error when I try to insert values into a table with multiple columns.

    I have:

    var db = google.gears.factory.create('beta.database');
        db.open('developerSet');
        db.execute('create table if not exists Developers (DeveloperName text, DeveloperAge int)');
    
        var devName = "Davy"
        var devAge = 32;
    
        try {
            db.execute('insert into Developers values (?, ?)', [devName, devAge]);
            alert('success');
        }
        catch (e) {
            alert(e);
        }
    

    I get the error:

    net.rim.device.api.database.DatabaseException; insert into developers values (?,?): SQL logic error or missing database.

    I use this reference: http://code.google.com/apis/gears/api_database.html

    Everything works if I have only one field as:

    var db = google.gears.factory.create('beta.database');
        db.open('developerSet');
        db.execute('create table if not exists Developers (DeveloperName text)');
    
        var devName = "Davy"
        var devAge = 32;
    
        try {
            db.execute('insert into Developers values (?)', [devName]);
            alert('success');
        }
        catch (e) {
            alert(e);
        }
    

    I use the plug-in Visual Studio 2.0 for 2008 that are running Windows XP SP and Simulator 2.13.0.56

    Thank you

    Davy

    Yes, a SQLite database will persist between battery pulls.  The database is registered either to internal MEM or removable media (not the device memory), depending on which is available on your device.

    In general, its not considered a best practice to remove your table as soon as it is empty and re - create it again when you want to add data.  This adds extra overhead fresh for the final, delete and insert first for a given table.  Instead, define and finalize your drawing before you create your table.  Once created, review the static schema.

    That being said, for development purposes, it may be easier to provide an easy way to drop your tables while you develop your schema.

    See you soon,.

    Adam

Maybe you are looking for

  • Was working and now get this message: this module requires java to work, but your browser doesn't support java not. How can I fix it?

    I'm trying to access a web application (webmin) and I get the following error message: This module requires java to work, but your browser does not support java It was working before. Chrome works fine, but I prefer firefox. One of my clients is havi

  • HP S5220SC: Ram Maximum for a HP S5220SC

    Hello Have an old HP computer that works absolutely fine except for speed. I currently 4 GB of Ram and you want to upgrade, but not sure it's possible. I can't find anything in my manual and found a site where it is written that it is not possible to

  • How to clear the cache keyboard on iPhone?

    I am a new user of iPhone. so it would be a stupid question, please never mind. During the strike, I discovered the suggestions were wrong, perhaps that the system just remembered the bad old tying. I need to erase the coz it's very annoying. Someone

  • microphone in labview data acquisition

    Hello My name is Michael. I want to get micro data in labview using connection jack 3.5 mm on my laptop. I looked in daqmax and did not see the microphone. Is it possible to enter these data in labview? Any help will be great. Thank you Michael

  • How to remove data in the Event Viewer log

    If I go to the event viewer in computer management and select these words. He did a search on the summary of the events of Admisitrator, recently seen nodes and newspaper summary. I want to remove all references in the summary of the events of the ad