Hi,
I have an igGrid, with column moving functionality and no data in the datasource. The datasource is a JSON object. Suppose I move a column when the grid is loaded (with no rows). Later when I add data to the datasource the grid data does not change according to the columns moved.
ex:
| A | B | C | D |
___________________________________
Column B moved to D
| A | D | C | B |
Data added to datasource:
A: 4, B: 3, C: 9, D: 8
shows the following grid
| 4 | 3 | 9 | 8 |
Please advice as to how to show data according to the new column format
Thank you
Hello Bhat,
Thank you for posting in our community.
Could you clarify which move type you have used for your grid?
I have created a sample where the ‘render’ move type is used so the DOM structure remains unchanged. The grid is just rendered with exchanged places of its columns. If you need detailed information on configuring column moving you might find useful the following resources: http://ko.infragistics.com/help/topic/6010c2a0-e86b-42f5-9c5c-b9f9238ba7a0;
http://ko.infragistics.com/help/topic/18ac9ebd-ab43-4974-9015-22c4a8cf51c6#_Ref345357842
I have also added the update feature in the sample in order to test the behavior with rows added when column positions have been already exchanged.
Feel free to modify the sample. If you have more questions or concerns please let me know.
Thank you for your reply.
However, I wanted to clarify that in the beginning, the datasource is empty, so is the grid. Then I move a column (with movetype : DOM or RENDER). Then I add data to the datasource and databind the grid. I am not adding rows with the update feature of the grid. I am adding rows to my datasource. At this time the header is moved to the new place but the column remains in its old position.
I hope this helps to understand my situation.