Hello,
the panellist looks pretty cool.
Is it possible to highlight an item, to show the user what item is currently selected? I would like to use it as drawer menu.
function SetStyleCGControl(ApplyStyle: Boolean; var css: String; Stylecss: string): Boolean;
var
I: Integer;
tempcss: string;
begin
tempcss := css;
I := Pos(Stylecss, tempcss);
// in case Stylecss is already in css
if (I > 0) and (ApplyStyle) then
begin
Result := False;
end
else
begin
if I > 0 then
Delete(tempcss, I, Length(StyleCss));
if ApplyStyle then
tempcss := tempcss + ' ' + Stylecss;
css := tempcss;
Result:=True;
end;
end;
{ TJqPanelListHelper }
procedure TJqPanelListHelper.SetSelection(Item: TIWCGPanelListItem; Selected: Boolean);
begin
if SelectIt(Item, Selected) then
Self.AjaxReRender;
end;
function TJqPanelListHelper.SelectIt(it: TIWCGPanelListItem; Selected: Boolean): Boolean;
var
TempCss: string;
begin
result := False;
if Assigned(it) then
begin
TempCss := it.ItemCss;
if SetStyleCGControl(Selected, TempCss, 'ui-state-highlight') then
begin
it.ItemCss := TempCss;
result := True;
end;
end;
end;
Jorge Sousa wrote:Hello Assapan
You don't need the AjaxReRender part, because you're only changing ItemCss which is already ajax ready.