How to remove the table column headers from Jqgrid subgrid
Asked Answered
W

1

0

I have the following jqgrid subgrid:
http://jsfiddle.net/mojarame/uDd9J/34/

I am trying to configure it like the following html table that has the jExpander Plugin http://jsfiddle.net/mojarame/S5V6C/12/

But the column headers in the first JS Fiddle Demo for the subgrid on the jqgrid are visible. How can I remove them?

Wadmal answered 31/5, 2012 at 19:13 Comment(6)
I don't see any table headers in the demo. I see only column headers. The width of the columns in the subgrid are not the same as in the main grid. So the existence of the column headers helpful. The demo contain no real data in the subgrid. Do you really need to display grid as subgrid or you want to display just line of text? Moreover you have CSS problems in the demo because no icons will be displayed. You have many errors in the JavaScript code and the code create many duplicates of id.Prothesis
I just posted the code to demonstrate the problem I am having with the first JS fiddle demo. The second demo is to demonstate that I want a table that has a row that expands without column headers.Wadmal
Sorry, but the second demo contains icons which will be not displayed. Moreover it one click on the "icon" I see just HTML fragment and no subgrid. So I asked you what you want to display of expanding the "+" icon? Do you want display below Subgid (another grid) or some common HTML fragmant?Prothesis
You are not seeing the icons because there are know images in the first demo. But if you click on the first column in the body you should see the row expand. When you see the row expand you will see that that there are column headers in the subgrid. I want to know how to remove them.Wadmal
Probably you don't understand my question about the difference between subgrid with common HTML fragment and the grid in subgrid. I'll write you a should a should answer which will describe what I mean.Prothesis
Ok thank looking forward to your answer.Wadmal
P
2

The demo with jExpander Plugin don't display any subgrid in my opinion. It display common HTML fragment in the line below. I suppose that what you need is not to create subgrid at all. Instead of this you can display any common HTML fragment which you need.

Look at the very old answer. The corresponding demo where I mostly uses the current jqGrid 4.3.3 display the following

enter image description here

jqGrid just create the row for subgrid data and place div in the cell having colSpan over the whole row. You get the id of the div as subgrid_id parameter of subGridRowExpanded. So you can place in the div any HTML fragment what you want. It must be not only another grid. If I understand correct your requirements then creating your custom HTML fragment with the data will solve your problem.

Prothesis answered 31/5, 2012 at 20:39 Comment(9)
This is exactly what I need I am looking at your code now. Thanks.Wadmal
@MojaRa: You are welcome! I thought, it's more helpful to see the implementation of "common HTML fragmant" as to read the description in comments. :-)Prothesis
Can I ask you a question? How do I customize the html in each subgrid row. I see you using the append function and the variable html. I am just having a brain freeze to make the data in each of these subgrid rows unique. If you need me to post this as a separate question to get point I will.Wadmal
@MojaRa: Probably it will be more clear to replace .append to .html? I modified the code of demo now. I placed already the text ... the row with id=... to make the text different in all rows. I wanted to show additionally that you can generate the HTML fragment based on the rowid (or the data from the row). Is it what you mean or you wanted something other?Prothesis
Would I use the jquery ajax and .each methods to specify unique content in each row. Because I am going to have different content in each of these rows like in this jsfiddle: jsfiddle.net/mojarame/S5V6CWadmal
@MojaRa: I hope that I understand now one more understanding problem which you have. The row with subgrid will be created on expanding of the grid and it will be deleted on collapsing of the grid. So you have to fill the data on every subGridRowExpanded the data will be removed per default. jqGrid call subGridRowExpanded if you don't use subGridOptions: {reloadOnExpand: false} explicitly. But event in the case the data can be created only at the first expanding of subgrid. On collapsing the data will be then hidden instead of removing.Prothesis
What I am going to do is write the javascript in a way so that you can understand where I am coming from give me a couple of hours and check back.Wadmal
@MojaRa: It's good idea! I find that the good example or better the demo can really good explain the problem which you have.Prothesis
Hey I just posted a new question if you get a chance please look at it thanks #10856370Wadmal

© 2022 - 2024 — McMap. All rights reserved.