:: Forum >> Version 2 >>

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
Tuesday, January 2, 2007
Can you just swap column and row indices in your data array?
Alex (ActiveWidgets)
Thursday, January 4, 2007
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
Friday, January 5, 2007
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(colrow){return col "." row});
obj.setSelectorText(function(row){return "row " row});

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

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

sufiya
Monday, January 8, 2007
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
Tuesday, January 9, 2007
pls anyone look at it and let me know how to perform this
sufiya
Thursday, January 11, 2007



This topic is archived.

Back to support forum

Forum search