ParamQuery grid support forum

General Category => ParamQuery Pro Evaluation Support => Topic started by: joevernon on January 21, 2016, 08:14:30 pm

Title: Removing expand functionality from rows with no data in detail grid
Post by: joevernon on January 21, 2016, 08:14:30 pm
Hi

I load data into my grid remotely and populate nested grids for entries that have data under a certain field. However an empty nested grid is produced for a row that has no data under that field.

Is there a way to remove the expand functionality, including removing the expand icon, for rows that have no data in the nested grid?

I have tried calling 'rowInvalidate' on rows that have no items for their nested grid however this does not seem to work.

Thank Joe
Title: Re: Removing expand functionality from rows with no data in detail grid
Post by: paramvir on January 21, 2016, 08:27:09 pm
Expand icon can be removed by column.render callback.

Code: [Select]
column.render = function ( ui ){
  if( there is no data in detail grid for current row i.e., ui.rowData ){
     return "";
  }
}

And beforeRowExpand event can be used to prevent default action of expansion of row by returning false.
http://paramquery.com/pro/api#event-beforeRowExpand
Title: Re: Removing expand functionality from rows with no data in detail grid
Post by: joevernon on January 21, 2016, 09:07:09 pm
Perfect, worked a treat.