How to group column in spark datagrid - flex4

I am using Spark Datagrid in my flex project. I want to add two columns under one header means I want a column grouping into Spark Datagrid. I have found many example regarding mx:datagrid and AdvancedDataGrid but I want in Spark Datagrid.How can achieve this in spark datagrid. Please help me its really important for me.
Thanks.

You can use a labelFunction to group two fields of your dataProvider into one column.
Example of labelFunction:
public function myLabelFunction(item:Object, column:GridColumn):String {
return item.field1+ " - " + item.field2;
}
The GriColumn:
<s:GridColumn labelFunction="myLabelFunction"/>

Related

How to create a custom formula using data validation that can sort columns using column numbers in Google Sheets?

I hope someone can help with a problem I’m facing. I’m pretty new to Data Validation using Custom Formulas so I’d appreciate your guidance. I hope I have explained the situation clearly. Thanks.
I want to use data validation in cell B1 (Portfolio Tab) which creates a drop down list of the number of columns (1 to 44). I want to use the list as a way to sort a table (Column Headers - C3:AT4).
https://docs.google.com/spreadsheets/d/1qunKbFGNzzGU9lNCPFow8igkR_gaPudmanTK-WM43mA/edit#gid=58173089
By selecting 1 from the drop down list I want my table to be sorted in Descending order by Portfolio%. Then if I want to sort by Name in Descending order I want to select 3 from the drop down list. Finally once I’m done sorting I want to revert back/reset to my original view. I want to do this without changing anything in columns A and B. Please assist. Thank You.
Issue with using asc
Issue with using asc (blank formula)
Query and hyperlink
Query and hyperlink
solution 1:
forget dropdown and use filter view inmerge row 3 & 4
delete row 1 & 4
select your range C2:AT
and creatte filter view
now you can sort one, multiple or all columns like:
solution 2:
create a duplicate of your sheet:
delete your range C3:AT
use this in C3:
=QUERY({Portfolio!C3:AT}, "order by Col"&B1&" desc", 2)
solution 3:
use sorting script... https://stackoverflow.com/questions/tagged/google-apps-script+sorting

Google Sheets - QUERY order by dependent drop down

I am trying to setup a QUERY with dynamic ordering. I've tried to link the ORDER BY function to the output of the dropdown menu but that doesnt seem to work. I have recreated the problem with a simple example: https://docs.google.com/spreadsheets/d/1m3Lhm5lp2DW7XF8hRbDAiOAAsOyCXrie-Nc-0bWG6hA/edit?usp=sharing
I've created a table (3x4) with three variable and would like to dynamically sort the table by each variable through QUERY both ascending and descending.
Would also be interested to learn if it's possible to dynamically setup the direction (ACS or DESC).
Any suggestions would be much appreciated.
Kind regards,
Webko
try:
=QUERY({A2:C6}, "order by Col"&MATCH(F1, A2:C2, 0)&" "&G1)
where G1 dropdown is asc,desc

tabulator filter: ungroup filter results

in my tabulator table I group specific rows. When I load the page I keep the groupings closed, so that the user can open those grouping he is interested in. (see attached screenshot)
But I would like to automatically open the groupings, when the user applies a filter to any column of the table. (because in this case I want him to see the results on first glance and I do not want him to open the grouping manually) Do you know how I can set up this specific requirement?
Open grouping when applying a column filter in tabulator js
Thank you very much in advance.
Best regards
To check when the table is filtered you can use the dataFiltered callback, you would need to check through the filters passed into the callback to make sure that there are filters actually applied before carrying out your app logic.
var table = new Tabulator("#example-table", {
dataFiltered:function(filters, rows){
//filters - array of filters currently applied
//rows - array of row components that pass the filters
},
});
You could the use the getGroups function to return an array of the Group Components for the table, and the itterate through the list and open the groups using the show function:
table.getGroups().forEach(function(group){
group.show();
});
I hope that helps,
Cheers
Oli :)

Getting specific column values in Hbase

Hi i am new to Hbase an want to ask some questions:
Suppose we have two column families in one table. cf1, cf2.
cf1 have following columns: id, name, age, email
cf2 have following columns: city,state,country
Now question is what will be they query to find cf2:city where cf1: name='xxx'
Kindly help on this. I am doing this in Java so any api which can do this ?
An answer with a detailed example will be very appreciative.
Regards
Use the SingleColumnValueFilters. Like this.
SingleColumnValueFilter('cf2','city',=,'binary:nameofthecity') AND SingleColumnValueFilter('cf1','name',=,'binary:xxx')
. Set it to the filter in the scan object and use this scan object to get the data from the table.

YUI DataTable - multiple columns filtering

I know, that it is possible to filter dataTable Control on client as it is shown in this exaple:
http://developer.yahoo.com/yui/examples/datatable/dt_localfilter.html
Is it also possible to filter more columns? I'd like to have 2 textfields, and when I type sth to the first one, DataTable would filter according to the 'areacode' (from the example) and when I type sth to the second one, DataTable would filter according to the 'state'.
Is this possible somehow? Thanks for any help.
The simplest way to modify the existing example would be to build a request string that contains the information for each text box. For example (column1=a&colum2=b), modify the doBeforeCallback to split the request and do the filtering for each column.

Resources