104
$this->SelectedParamId=-1;
$this->EditSearch->javascript_OnKeyPress="if(event.keyCode==13) ".
$this->ButtonSearch->FullName().".onclick();";
$this->FillTreeAttributes();
$this->ViewFormAlias="FormView_clients";
}
protected function FillTreeAttributes()
{
$this->TreeAttributes->Clear();
$parent_node=new ONode("Все", $this->TreeAttributes, -1,
"/images/icons/receipts.png");
$this->TreeAttributes->AddNode($parent_node, "");
$this->TreeAttributes->Value=0;
$query="SELECT * FROM table_client_params ORDER BY NAME";
$ds=new ODBDataSet("", $this, GetConnection("MainDBConnection"));
$ds->Open($query);
for($i=0; $i<$ds->RowCount; $i++)
{
$ds->SetRow($i);
$node=new ONode($ds->GetFieldValue("NAME"), $this->TreeAttributes,
$ds->GetFieldValue("ID"), "/images/icons/receipt.png");
$this->TreeAttributes->AddNode($node, $parent_node);
}
AddToChangedComponents($this->TreeAttributes);
}
protected function GetDataListQuery($_search_text="")
{
$result="";
if($_search_text=="")
{
$result=WorkSpaceQueryCollection($this->SelectedParamId==-1?$this-
>SelectQueryAlias:
$this->ParamSelectQueryAlias, array("ID_PARAM"=>$this-
>SelectedParamId));
}
else
{
$result=WorkSpaceQueryCollection($this->SelectedParamId==-1?
$this->SearchSelectQueryAlias:$this->ParamSearchSelectQueryAlias,
array("SEARCH_TEXT"=>$_search_text, "ID_PARAM"=>$this-
>SelectedParamId));
}
return $result;
}
protected function ButtonSearch_OnClick($_sender, $_event,
$_event_args=null)
{
$this->FillDataList($this->EditSearch->Value);