I found out how to sort a JSON array at http://www.devcurry.com/2010/05/sorting-json-array.html
Now I want to sort it in a generic way; so that my sorting function k
See this example http://jsfiddle.net/W8Byu/1/
What I have done is stored the sort column Name in a variable and used in Sort function.
var sortColumnName = "Name";
function SortByName(x,y) {
return ((x[sortColumnName] == y[sortColumnName]) ? 0 : ((x[sortColumnName]> y[sortColumnName]) ? 1 : -1 ));
}