EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: crosemffet on December 09, 2012, 03:48:08 PM



Title: Expand row in DataGrid with subgrid
Post by: crosemffet on December 09, 2012, 03:48:08 PM
let's imagine this situation:
I have one grid with 10 rows.
only row 2 and 5 has data to show in the subgrid, if expanded.
there's any chance that the plus sign at left of the grid shows only in the rows that has expanded data, and the rest doesn't show?
in other words, only row 2 and 5 with the plus sign (+) and the rest without it ?
thanks in advance


Title: Re: Expand row in DataGrid with subgrid
Post by: stworthy on December 10, 2012, 01:10:56 AM
To hide the expander icon, try the following code:
Code:
var expander = $('#dg').datagrid('getExpander', 2);  // get the third row expander, the row index start with 0
expander.hide();


Title: Re: Expand row in DataGrid with subgrid
Post by: brettjw on October 17, 2013, 08:13:13 AM
@stworthy - I am using the subgrid code directly from the website demo and I was wondering if there was a way to do this that would be more dynamic - meaning that if the subgrid query did not have any results then it hide the expander. I have tried to implement this example and could not get it to work- it may be my lack of knowledge about EasyUI, but if you could provide a example that shows this code in line with the demo - that would be great. Thanks for your support. I have been looking for the subgrid option for years and I am very excited to implement it, just need to get a few things working.

Thanks again!