0

I am trying to create tabular report using JQGrid, JavaScript. I want to add a rowgroup header spanning whole row, and repeat this group using JQgrid and JavaScript. The data is going to come from JSON file.

I've already explored options of rowgroup using Jqgrid. But, instead of static header spanning, it gives header with expand/collapse function. It is not able to give Total for two rows in each column. Also I am not able to repeat leftmost column in it.

halfer
  • 19,824
  • 17
  • 99
  • 186
Parth
  • 11
  • 2
  • Sorry, but it not clear enough for me what you want to implement. You wrote about "rowgroup header". What you mean exactly? Posting of JavaScript or HTML code or some pictures could clear what you need to implement. Probably you need implement column grouping. Look at [the documentation](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:groupingheadar). Depend on some options it will be used `colspan` and `rowspan` in the column headers, but in no `rowgroup`. – Oleg Sep 04 '15 at 07:43
  • As you know we could create rowGroup in JQgrid and each group has a header. I wanted to develop a similar view for my grid without using groupview property of JQgrid. Bcause if we use Groupview, it comes with expand/collapse button which I do not want for my grid. However, Now I was able to remove the expand/collapse button and got the desired view. Thanks for taking out time for my query. – Parth Sep 07 '15 at 08:22
  • You are welcome! The correct name for the feature which you use [data grouping](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:jqgriddocs#data_grouping) by including `grouping:true`, groupingView: {...}` options. jqGrid group rows by specified column/columns and insert grouping header before the group of rows. You can customize the grouping header by using `formatDisplayField` callback. Using `plusicon` and `minusicon` you can customize the icon. I think that you can easy make it always hidden if required by corresponding CSS styles of `plusicon` and `minusicon`. – Oleg Sep 07 '15 at 08:41
  • As I am new to JQGrid, it was some useful info for me. :) and Yes, I did that only. I've hidden the icon using $('.tree-wrap-ltr').hide(); on loadComplete function. – Parth Sep 07 '15 at 08:46

1 Answers1

0

You can use plusicon and minusicon options which specify the icons used by jqGrid group. If you need to hold the icons hidden that the corresponding classes should have display: none prorty. For example you can use

groupingView: {
    ... // your other options
    plusicon: "ui-helper-hidden",
    minusicon: "ui-helper-hidden"
}

If you need customize the grouping row additionally, then you can use formatDisplayField callback. See the answer, this one, this post and this one.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798