Author Topic: prevent a detailgrid from opening?  (Read 1795 times)

MEngelbyPQ

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 21
    • View Profile
prevent a detailgrid from opening?
« on: September 21, 2018, 12:11:10 am »
I have grid where the column Model has a detail column.  Is there a way to prevent the detailGrid from expanding when the detail icon is clicked on in the row?
Based on the rowData I have logic that determines if the detailGrid will be valid or not and I'm wondering if there is a way to to prevent the grid from opening when there is no data to show for the detail?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: prevent a detailgrid from opening?
« Reply #1 on: September 21, 2018, 11:54:37 am »
There is beforeRowExpand event to do that.

https://paramquery.com/pro/api#event-beforeRowExpand

MEngelbyPQ

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: prevent a detailgrid from opening?
« Reply #2 on: September 21, 2018, 06:44:41 pm »
Many thanks.  I was able to add it during initialization with:
Code: [Select]
$('#selector').pqGrid({beforeRowExpand: function(evt, ui) {
    if (ui.rowData.lastread == 'NOT CURRENT') {
        return false;
    }
    return true;
}});