Author Topic: Removing expand functionality from rows with no data in detail grid  (Read 2911 times)

joevernon

  • Newbie
  • *
  • Posts: 5
    • View Profile
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

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6255
    • View Profile
Re: Removing expand functionality from rows with no data in detail grid
« Reply #1 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

joevernon

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Removing expand functionality from rows with no data in detail grid
« Reply #2 on: January 21, 2016, 09:07:09 pm »
Perfect, worked a treat.
« Last Edit: January 21, 2016, 09:57:35 pm by joevernon »