How can I to change column data in the row and row data in the column?

QuestionsHow can I to change column data in the row and row data in the column?
[email protected] asked 6 years ago

Fecha | 13-05-2014 | 18-05-2017 | 20-06-2018

Juan   | 25 kg.       |  25,8 kg.      | 25,9 kg.

Pedro |  23 kg.       | 24 kg.          | 24,8 kg.

Mary  |  26 kg.       | 26,5 kg.       | 26,8 kg.

Change data orientation .

thank you

6 Answers
Abu Ghufran Staff answered 6 years ago

If your data is readonly, you can fill the data in php array and then transpose php array (try searching google / stackoverflow). Then load transformed array to grid using following demo.

Code: https://www.phpgrid.org/demo/demos/loading/load-array.phps

Demo: https://www.phpgrid.org/demo/demos/loading/load-array.php

 

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
[email protected] answered 6 years ago

Thank you Abu,

but I have a bit detail. the date column increases, it’s not static. And I will have to use the horizontal scroll.

Abu Ghufran Staff answered 6 years ago

Send me the source data (or sql table structure) which you need to be transposed.

I’ll try to create a demo and send you.

You can email me at [email protected]

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
[email protected] answered 6 years ago

I think you should think the other way around. Change columns by rows and rows by columns.
Horizontal scroll moves with record and vertical scroll with fields.

It’s like turning the screen. Horizontal to vertical.

Abu Ghufran Staff answered 6 years ago

I understand better now. I think you are looking for this:

https://www.jqueryscript.net/demo/Transpose-Table-jQuery-Plugin/
https://github.com/riteshgandhi/jquery.table.transpose

OR

https://stackoverflow.com/a/25797426/8743891

Both above solutions are not supported with our grid right now. Basically the problem is the underlying structure of grid is not just <table></table>. it’s little complex so transpose function will be difficult and need core level changes.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
[email protected] answered 6 years ago

Thank you a lot of!

You are cool!

Your Answer

11 + 10 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?