CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Ability to manage tags of Inner DIV of CG Controls

Questions & Answers about IWCGJQuery Suite.

by MCarver » 10 Oct 2014 23:47

CG Gurus,

I am attempting to override the default behavior of a TIWCGJQImage control. It renders improperly with a template. See below:
<div class="cc-image " id="IMGCALCSUBSIDY"><img src="/files/images/quotes/2014/Side-Nav-Icon-calculator.png" id="IMGCALCSUBSIDY_IMG" width="100%" height="100%" onclick="{ var url = '&amp;submitevent=OnClick'; SubmitClickConfirm('IMGCALCSUBSIDY',url,true,''); }"></div>

The above syntax makes the image 100% in the placed DIV. Yes, that can be over ridden by defining the proper height/width in the outer div class. But who wants to create a class for every image just to define the proper image size. The resulting displayed image is VERY large as it sits in a DIV that is very large.

So I need a way to remove the inner width/height of 100%. When this is removed, it renders correctly. I had hoped to find an "Inner" property like exists in the TIWCGJQEdit, but no such luck.

In general, I need the ability to remove (or add) any given tag from within the inner DIV of ANY CG Control.

Thanks for your attention on this matter.

Regards,
Monte Carver
MCarver
 
Posts: 48
Joined: 27 Sep 2013 19:15

by Jorge Sousa » 13 Oct 2014 12:09

Hello

Despite the following facts:

1- We don't see any problem with the width=100% height=100% even if the outter div has no style at all.
2- OnHTMLTag and TIWHTMLTag are Intraweb event and class respectively.

You can do something like this:

Code: Select all
procedure TFrmMain.IWCGJQImage1HTMLTag(ASender: TObject; ATag: TIWHTMLTag);
var
  i: Integer;
  Item: TIWMarkupLanguageElement;
begin
  for i:= 0 to ATag.Contents.Count - 1 do
  begin
    Item:= ATag.Contents[i];
    if (Item is TIWHTMLTag) and SameText(TIWHTMLTag(Item).Tag,'img') then
    begin
      TIWHTMLTag(Item).ClearParam('style');
      Break;
    end;
  end;
end;

Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58


Return to Q & A

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.