Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQGrid - How Can We make an Custom Row Detail

Tags:

jqgrid

subgrid

Some one give me the some Sample Code to make my Grid like this.I read in document that jqgrid just supports subgrid.

like this page in Hierachy http://trirand.net/demoaspnetmvc.aspx

thanks !

like image 437
lovedota Avatar asked Nov 06 '10 18:11

lovedota


People also ask

How do I highlight a row in jqGrid?

If the row which you need highlight has the id 123 you can just use setSelection method for selecting: jQuery('#tab_Categorize'). jqGrid('setSelection', '123');

What is rowNum in jqGrid?

jqGrid exposes a property rowNum where you can set the number of rows to display for each page.

How do I add edit and delete button for jqGrid for every row?

Mention editLink and deleteLink in colModel name of edit and delete for display Edit and Delete button in jqgrid for each row. Show activity on this post. I got it, Just take additional column, and add formaater actions as model class. That's it.


1 Answers

On the page Custom Row Detail you can see how you can use subGridRowExpanded event handle to show custom HTML data as subgrid data. In general if you have any standard jqGrid you can implement the same very easy. You should just add subGrid: true to the grid and define subGridRowExpanded which append html to the subgrid:

subGridRowExpanded: function(subgrid_id, row_id) {
    var html = "<span>Some HTML text which corresponds the row with id="+
               row_id + "</span><br/>";
    $("#" + subgrid_id).append(html);
}

You can see this live here:

like image 190
Oleg Avatar answered Oct 01 '22 01:10

Oleg