Me on Kamla Bhatt Show – Part 2

January 31, 2008

Welcome Anirudh & Sujit

January 30, 2008

Our evangelism team here in India got a boost last month when two bright guys joined our team. I’m extremely happy to welcome them to the family.

Anirudh Sasikumar is a hardcore programmer who comes to us from the world of C++ & Linux. He loves LISP and OpenGL and loves to dive into anything where he can apply his mind. He joins us from Procsys and has tried his hand at Flex & AJAX before.

Β Sujit Reddy has muddled his hands in Java, J2EE, Flash & ActionScript2.0. He is surely a go-getter with a lot of enthusiasm packed within.

You should check out their blogs, they have already stared to post some very interesting stuff there… πŸ™‚


Programmatic multi-column sorting on DataGrid or AdvancedDataGrid

January 25, 2008

One of the most requested features in the DataGrid (DG) was the ability to do multi-column sorting. This request was addressed by the engineering team in the AdvancedDataGrid (ADG) Component. It gives you a very neat UI indication and multiple ways to do multi-column sorting. But what this post is about is how one can do a programmatic multi-column sorting so that the user is presented with data that is already multi-column sorted.

You do not need an ADG for programmatic multi-column sorting. The trick lies in populating the Sort object of the Collection (which is the dataProvider of the Grid), with an array of sort fields which specify how the multi-column soring needs to be. But having said that, if you are using an ADG, then you get a arrow-indicator that the column is in the sort order and a number indicating where in the sort order it lies.

Consider a variable called myDP which is an ArrayCollection that populates the DG or ADG. The Collection has 3 fields [“artist”, “album_name”, “price”]. Our objective is to sort the Artist by ascending order and then the price by an ascending order, so that you can find the least costly object for each artist. The code below lets you do this…

var sortThese:Sort = new Sort();
sortThese.fields = [new SortField(“artist”, true, false), new SortField(“price”, true, false,true)];
myDP.sort= sortThese;
myDP.refresh();

The SortField class constructor is of the construct as below.

SortField() Constructor
public function SortField(name:String = null, caseInsensitive:Boolean = false, descending:Boolean = false, numeric:Object = null)

Parameters
name:String (default = null) β€” The name of the property that this field uses for comparison

caseInsensitive:Boolean (default = false) β€” When sorting strings, it tells whether to ignore the case of the values.

descending:Boolean (default = false) β€” Tells whether to arrange items in descending order.

numeric:Object (default = null) β€” Tells whether to compare sort items as numbers, instead of alphabetically.

Below are the results when the ArrayCollection is attached to a DG, normal ADG & an ADG with sortExpertMode turned on. By default, the sortExpertMode property is set to false, which means you click in the header area of a column to sort the rows of the AdvancedDataGrid control by that column. You then click in the multiple-column sort area of the header to sort by additional columns. If you set the sortExpertMode property to true, you use the Control key to select every column after the first column to perform sort.

Multi-column sorting in DataGrid
Multi-column sorting in a default AdvancedDataGrid
Multi-column sorting in an AdvancedDataGrid
with sortExpertMode=true

Me on Kamla Bhatt Show – Part 1

January 9, 2008

Kamla Bhatt is an Indian blogger who has attained celebrity status and is acclaimed as India’s first podcaster. I had the pleasure of being introduced to Kamla at the Yahoo HackDay in Bangalore. She also covered the initRIA conference that we had conducted and also took Shantanu’s interview…

Here in this episode, I am showing the Sony Ericsson India website which has a Flex App which will let you shop for phones. Then I go onto talk about AIR. But there is a small blooper in there. While explaining the AIR runtime, Kamla interjects and asks me if we need to install the AIR runtime to see the Sony Ericsson website and I say yes 😦

The question actually was misheard by me in the din. Anyway just to clarify…

The Sony Ericsson website is made in Flex and requires only a FlashPlayer to run it. I was talking of a hypothetical situation when Sony might take the application onto the desktop and then one will have to install AIR to install that desktop App…

Here’s the episode:


Happy New Year…

January 2, 2008

Just back from a vacation to my hometown… I have been un-plugged from the web for the past week.

I was trying to catch up with some happenings in the RIA world and came across some posts which I thought I should share here

HAPPY NEW YEAR to everyone…