Get KoolPHP UI with 30% OFF!

Filter row, hide filter options row

Stefan
Dear Koolphp-Support,
for a customer project I was asked if it is possible to hide the filter option row of the gird (with Equals, greater than, etc.)? The first row should contain the filter elements i.e. status of a given entry and the default filter option should always be "equals". I was able to limit the entries of the filter options row to only "equals", but I was not able to hide the row completely. Is this possible?
Thank you for pointing me in the right direction.
Yours,
Stefan
Found it myself:
Handle the OnLoad-Event of the grid, adjust layout via css.
function Handle_OnLoad(sender,args)
	{
		HideFilterOptions();
	}
function HideFilterOptions(){
		var e = document.getElementById('grid_mt_c5_filter_select');
		if (typeof(e) != 'undefined' && e != null){
		e.style.height = "0px";  
		e.style.width = "0px";  
		e.style.border = "#FFFFFF";	
	}
}
Posted Jan 25, 2016 , edited Jan 28, 2016 Kool -
Hallie
Hi Stefan,
Can you show me how you were able to limit the filter entries?
Posted Mar 9, 2017 Kool
Anthony Amolochitis
I just set filter options to false on the column object when adding the column to the grid. That removes the filter.
If you want to limit the filter entries, create a GridDropDownColumn and add your limited entries to it, and turn on filtering. Only those options will be selectable.
Posted Mar 9, 2017 Kool
Hallie
Thanks for the quick response,
I want to "edit" the filter drop down to equal "contain" and it not to show on the grid? Is this possible, I have tried following the logic in the forum and can't replicate it on my end.
Any help is appreciated!
Posted Mar 9, 2017 Kool
Anthony Amolochitis
Here is an example of adding a drop down column with filter options customized.
        $column = new griddropdowncolumn()  ;
        $column->DataField = 'saleRepId'    ;
        $column->Width = '100px'            ;
        $column->HeaderText = 'Rep'         ;
        $column->Valign = 'top'             ;
        $column->FilterOptions = array('No_Filter','Equal','Not_Equal');  // Custom filters here have equal and not equal, but you can add contain too
        $column->additem('None','0')        ;
        foreach( $this->SalesUsers as $userRow )
        {
            $name = $userRow['fnam'] . ' ' . $userRow['lnam'];
            $userId = $userRow['userid'];
            $column->additem($name,$userId);
        }
        $this->KoolGrid->MasterTable->addcolumn($column) ;
Posted Mar 9, 2017 Kool