0

I have a requirement where I need to add dynamic columns in a grid. Let say I have a product of type CAR. So it has attribute like ID, Color, Type, Finish. Let say there is another product of type Cloth with attribute like ID, Color, Finish, Size, FIT.

Now requirement is when grid will load product of type Cloth, it should only show column ID, Color, Finish, Size, FIT not Type which is for CAR.

I tried with this

But it does not support paging, sorting.

What will be good option to achieve above requirement. Does any one implement jqGrid with this type of requirement.

Community
  • 1
  • 1
user1926138
  • 1,464
  • 7
  • 34
  • 53
  • 1
    Whats your final code look like using JQ grid? – Imad Jan 10 '17 at 07:48
  • It's better that you include some **examples** of JSON data or the JavaScript object (array of items), which you want to use as the source of jqGrid. Do you have all the properties in all items of input data? Which type of data you have in different columns? (for example `Size` could be need formatted and sorted as number or integer, some other properties should be interpreted as strings, you could has dates in some format and so on). If it's so, then you can scan properties of the first element of the input data to generate `colModel` and you can create the grid using the generated `colModel` – Oleg Jan 10 '17 at 08:19
  • Why you don't try this link: http://stackoverflow.com/questions/16261993/jqgrid-dynamic-columns-and-data-by-json – ThinhLe Jan 10 '17 at 09:37

0 Answers0