ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: MEngelbyPQ on September 21, 2018, 12:11:10 am

Title: prevent a detailgrid from opening?
Post by: MEngelbyPQ 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?
Title: Re: prevent a detailgrid from opening?
Post by: paramvir on September 21, 2018, 11:54:37 am
There is beforeRowExpand event to do that.

https://paramquery.com/pro/api#event-beforeRowExpand
Title: Re: prevent a detailgrid from opening?
Post by: MEngelbyPQ 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;
}});