3.2.0

How to change the datagrid column structure to row

i am using datagrid product, by default it display headers in Top row and relevant data in other rows( records are displayed in row way now i need column way)
But i want to display headers in first column rest of the records in other column

do we have any support for this in data grid if yes what all the changes i should make, if not what is the other solution.

example:
empid empName
1 sufy
2 far
3 shr

The above should be displayed as follows using data grid

empid 1 2 3
empName sufy far sha

Thanks in advance
sufiya
January 2,
Can you just swap column and row indices in your data array?
Alex (ActiveWidgets)
January 4,
Well i could able to do it for grid ( i mean data) but not for headers
when i see innerHTML of header data headers are appened to span so it comes in same line how to convert it for div or any suggestion
sufiya
January 5,
You can hide column headers and unhide row selectors:

var obj = new AW.Grid.Extended;
obj.setFixedLeft(0);

obj.setHeaderVisible(false); // hide column headers
obj.setSelectorVisible(true); // show row headers (selectors)
obj.setSelectorWidth(75);

obj.setCellData(function(col, row){return col + "." + row});
obj.setSelectorText(function(row){return "row " + row});

obj.setColumnCount(10);
obj.setRowCount(20);

document.write(obj);
Alex (ActiveWidgets)
January 5,
Wow! thanks a lot Alex
great help

sufiya
January 8,
Hi Alex,
I have a question
After doing the above now if i add new record to the grid its adding horizontally rest of the data is fine

Ex:
new record disply horizontally it should display verically(column wise)

4 manu 400
empid 1 2 3
empName sufy far sha
empsal 100 200 300

where exactly i should make this changes in deltas/JSON or how ?
sufiya
January 9,
pls anyone look at it and let me know how to perform this
sufiya
January 11,

This topic is archived.

See also:


Back to support forum