Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Goodgulf

Pages: [1]
1
I am doing it like this.  Once you set the value, you need to trigger the change event for the filter.  There may be a cleaner way to do it though.

Code: [Select]
function fncPopulateGrid(oData){
// Load the data into the grid.
$oGrid.pqGrid("option", "dataModel.data", oData);

// Set up the recordsets for our three selection box filters.
var oColumnModel = $oGrid.pqGrid("option", "colModel");
oColumnModel[2].filter = { type: "select", condition: "equal", prepend: {'': ""}, valueIndx: "PaymentPeriod", labelIndx: "PaymentPeriod",
listeners: ['change'], options: $oGrid.pqGrid("getData", { dataIndx: ["PaymentPeriod"]})};
oColumnModel[3].filter = { type: "select", condition: "equal", prepend: {'': ""}, valueIndx: "AgencyName", labelIndx: "AgencyName",
listeners: ['change'], options: $oGrid.pqGrid("getData", { dataIndx: ["AgencyName"]})};
oColumnModel[4].filter = { type: "select", condition: "equal", prepend: {'': ""}, valueIndx: "PayStatus", labelIndx: "PayStatus",
listeners: ['change'], options: $oGrid.pqGrid("getData", { dataIndx: ["PayStatus"]})};
$oGrid.pqGrid("option", "colModel", oColumnModel);

// Let's set the default value fo "Pay Status" to "Released" if appropriate.
if($.inArray('Released', oColumnModel[4].filter.options !== -1)){
oColumnModel[4].filter.value = 'Released';
}

// Now that the grid is loaded with data and the filters are set up, let's update the client's view.
$oGrid.pqGrid("refreshDataAndView");

// Trigger the filter event for the "PayStatus" column since we are re-selecting a value.
$("select[name='PayStatus']" ).change();
}

Pages: [1]