Jump to content

Please help with javascript: Change Image


erich.wanker

Recommended Posts

[Webmode]  Hello,

 

i am trying to make a little selfmade Grid at runtime ;-) 

 

at runtime i create uniPanels

 - every unipanel has a unique tag value ...the name is PNL + the unique Number

 

every unipanel has a uniImage

 - the uniImage has the same tag value like the parent uniPanel  ... the name is IMG + the unique Number

 

 

Now i want to "select" a panel with a single click .. and the picture of the uniImage should be changed to "select.gif" 

.. and a second click should change the picture to "noselect.gif" 

 

And with a double click - i want to show informations of the doubleclicked record

 

Can someone help me with this ?

ThanX

Erich

 

 

Link to comment
Share on other sites

in the mean time - i made it with delphi ...  javascript is not a strangth of me ;-) ...

procedure my_panel_click ...

    for i:=0 to (sender as TuniPanel).ComponentCount-1 do
      begin
       if (sender as TuniPanel).Components[i].ClassName= 'TUniImage' then
           begin
           if ((sender as TuniPanel).Components[i] as TUniImage).Name = 'IMG'+inttostr((sender as TuniPanel).tag) then
                 begin
                       if ((sender as TuniPanel).Components[i] as TUniImage).Tag = 0 then
                       begin
                        ((sender as TuniPanel).Components[i] as TUniImage).Tag:=1;
                        ((sender as TuniPanel).Components[i] as TUniImage).Picture.LoadFromFile(uniServerModule.FilesFolderPath+'folder_orange_voll.gif');
                       end
                       else
                       begin
                        ((sender as TuniPanel).Components[i] as TUniImage).Tag:=0;
                        ((sender as TuniPanel).Components[i] as TUniImage).Picture.LoadFromFile(uniServerModule.FilesFolderPath+'folder_orange_leer.gif');
                       end;
                 end;
           end;
      end;

this in javascript would be nice ;-) .. better performance  ..

 

Nice greetings

erich

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...