Sort FlexTable Inquiry - gwt

i use Flex Table to display the data .
now i need ti support that when the user click on the table header the table be sorted according to the column selected .
but i need the sorting not to be slow.
is flex table can support this property ....if yes how can i do it .... if not is there is another way to do it ..? and how can i do it ?
best regards,
Ahmed Shoeib

FlexTable is not the good widget to display data, since the 2.1 version you should consider using CellTable
Moreove, since the version 2.2, the CellTable widget supports columns sorting. See the documentation

Related

Sencha GXT3 - Grid Column Header: Doubleclick Handler between two column headers

I have the following problem:
customer wants Excel like behaviour on a table. When double-clicking on the space between two column-headers, the column should be sized like the biggest text inside that column.
Question: Is there a build in GXT function to add a Handler to the space between two column headers? I havent found sth. like that, browsing the documentation of grid...
Additional Information: GXT: 3.0.1 GWT: 2.5.1
Thank you very much!
No, it doesn't seem GXT exposes any handlers for actions on the column separators. A possible solution would be to have a option in the column drop down. There is an aricle about that here: http://greatlogic.com/2014/06/02/autofit-column-width-in-a-gxt-grid/

Create GWT CellTable Dynamically - sorting

Create GWT CellTable Dynamically -
refer to the earlier question : Create GWT CellTable Dynamically
for this dynamic celltable, I would like to do sorting based on a column dynamically.
How to do the comparator ?
My first SO question ! thanks in advance

is anybody have idea in gwt celltree as a celltable column??? Because GWT does not have tree table

I want to use cell tree as a cell table column. because GWT does not have tree table. In my current project, I have to make feature like item and it's subitem in cell table. so it is not possible without tree table
If any body have idea of this then please help to make it possible.
GWT 2.5 (to be released in a month or so) will add a CellTableBuilder that will let you generate additional rows; handling events on them will allow you to show/hide "child rows", mimicking a tree table.
Alternately, and withou waiting for 2.5, you can have your cells in a CellTree render columns (use a CompositeCell for flexibility and reuse). AFAICT thus is how Google Groups shows the unread count and menu for your favorite groups.
I am trying build tree table with tree widget plus flextable only. With the help of both, I am able to create custom tree table widget.
http://examples.roughian.com/index.htm#Widgets~Tree
finally..I able to create custom tree table as requirement.

How to Force a Sorting in a SWT Table w/ Table Viewer

I want to sort, only for the first time, a SWT Table column.
I have a Table with their TableViewer and I want to Sort programmaticaly after or before setInput Method.
The columns are dynamically generated, and the last ones is an average column.
Is there any way of Sorting by program?
I'm using only this line of code:
columnPromEcr = new TableColumn(table, SWT.RIGHT);
columnPromEcr.setText("Prom. ECR");
columnPromEcr.pack();
columnPromEcr.setResizable(true);
this.table.setSortColumn(columnPromEcr);
After setInput method I call:
// refresh table
tableViewer.refresh();
table.setRedraw(true);
Do I need a class ViewerSorter?
I don't need user intervention, my data came unordered, and after creating a dynamic column I want the program to order the table with that info, numeric data.
You don't need ViewerSorter if you only want to sort items before they are displayed. Use Comparator and Collections.sort().
Yes, use a ViewerSorter, it will keep the TableViewer in order all the time.
If u want the default behavior for sorting(integer,string simple comparison) you can just set the sorter:
viewer.setSorter(new ViewerSorter());
and the viewer will be sorted all the time (e.g. after deletions,additions of data)

how to relate a flextable row with a database row in gwt

i'm creating a simple project to try gwt, but i'm a real noob :)
i've a table in my db, each row in this table has a unique id.
i want my application to read this table and display it's contents in a flextable, omitting the column containing the unique id in the db, 'cause the user is not interested in that id.
after that, i want the user to click on a row of the flextable and get a detailed view... but i need my unique id to get the detailed data about that row in my db!
i'm able to determine in which cell of the flextable the user clicked, so i created a simple widget with a string property and an int property, and i add this widget to the flextable setting the string property to the text from the db i want to display in the flextable and the int property with the db id value... when the user clicks, i get the widget contained in the cell and i can get my id back... but it looks like a very complex solution.
Creating a custom widget is the way to go as soon as your requirements exceed the functionality of the standard widgets provided by GWT.
Note: you may want to reconsider and use Grid instead of FlexTable. Grid seems better in your case since each row contains the same number of cells. See related topic about Grid and FlexTable comparison.