Page 1 of 1

tabs close icon does not work ?

PostPosted: 03 Apr 2016 20:28
by amirreza_asadpour
hello sir . i set itab.closeicon;=true , but it does not work , also the close icon in demo version dose not work. please help me .
thank you very much

Re: tabs close icon does not work ?

PostPosted: 04 Apr 2016 14:29
by Alexander Bulei
Hi amirreza_asadpour,

You need implement the TabClose event and close by yourself.
We have removed the automatic remove, to provide the possibility to avoid closing.

delphi code
procedure TIWForm10.IWCGJQTabs1JQTabOptionsTabClose(Sender: TObject; AParams: TStringList);
var
Index: Integer;
Tab: TIWCGJQTab;
begin
if TryStrToInt(AParams.Values['$Arg_Index'], Index) then
begin
Tab:= IWCGJQTabs1.Tabs[Index];
IWCGJQTabs1.DeleteTab(Tab);
end;
end;


Best Regards.

Re: tabs close icon does not work ?

PostPosted: 04 Apr 2016 19:29
by amirreza_asadpour
Hi Alexander Bulei . thank you a lot for your answer but It dose not work again :(

what should i do ? i used another button to close the selected tab and it work but the X is not working .
please help me .

can you send me a sample project ?

Re: tabs close icon does not work ?

PostPosted: 05 Apr 2016 09:12
by Alexander Bulei
Hi amirreza_asadpour,

It works as expected here.
Please make the simple testcase project to detect your problem.

Best Regards.

Re: tabs close icon does not work ?

PostPosted: 05 Apr 2016 19:28
by assapan
Hi AjaxRender is missing

Code: Select all
procedure TIWForm4.IWCGJQTabs1JQTabOptionsTabClose(Sender: TObject;
  AParams: TStringList);
var
  Index: Integer;
  Tab: TIWCGJQTab;
begin
  if TryStrToInt(AParams.Values['$Arg_Index'], Index) then
  begin
    Tab:= IWCGJQTabs1.Tabs[Index];
    IWCGJQTabs1.DeleteTab(Tab);
    IWCGJQTabs1.AjaxReRender();
  end;
end;

Re: tabs close icon does not work ?

PostPosted: 06 Apr 2016 09:24
by Alexander Bulei
Hi,

I checked better this case, and you don't need have the code OnTabClose event.
Just assign the event....

The component have internal code to remove the tab when event is assigned.
And if you want prevent the closing, just raise the exception.

Best Regards.