New proposal
Tue, 06/21/2011 - 08:29
hello everyone,
Juste one proposal to FilterListbox.
It will great to have a posibility to change the first FilterListBoxItem wich added automaticaly : "-Any-"
I think It will be possible by filterListBox_Create.
What are you tell about this subject ?
<?php
/**
* This function creates a listbox suitable for the filter bar
* @param string $strControlId id based on the column that the control is contained
* @param string $strControlName The name to give the textbox
* @param string[] $arrListValues A name=>value array of items to add to the list
* @param string $strSelectedValue The value to start selected
* @param string $strFirstItem The Item to start list
* @return QListBox the resulting listbox
**/
protected function filterListBox_Create($strControlId, $strControlName, $arrListValues, $strSelectedValue, $strFirstItem)
{
$ctlFilterListbox = new QListBox($this, $strControlId);
$ctlFilterListbox->Name = $strControlName;
$ctlFilterListbox->AddItem($strFirstItem);
$ctlFilterListbox->FontSize = $this->RowStyle->FontSize;
$ctlFilterListbox->Width = 'auto';
//Now fill up the advanced list
foreach (array_keys($arrListValues) as $strFilterName) {
$ctlFilterListbox->AddItem($strFilterName,$strFilterName);
}
$ctlFilterListbox->SelectedName = $strSelectedValue;
return $ctlFilterListbox;
}
?>