Jump to content

Please help with javascript: Change Image


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 ?





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
       if (sender as TuniPanel).Components[i].ClassName= 'TUniImage' then
           if ((sender as TuniPanel).Components[i] as TUniImage).Name = 'IMG'+inttostr((sender as TuniPanel).tag) then
                       if ((sender as TuniPanel).Components[i] as TUniImage).Tag = 0 then
                        ((sender as TuniPanel).Components[i] as TUniImage).Tag:=1;
                        ((sender as TuniPanel).Components[i] as TUniImage).Picture.LoadFromFile(uniServerModule.FilesFolderPath+'folder_orange_voll.gif');
                        ((sender as TuniPanel).Components[i] as TUniImage).Tag:=0;
                        ((sender as TuniPanel).Components[i] as TUniImage).Picture.LoadFromFile(uniServerModule.FilesFolderPath+'folder_orange_leer.gif');

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


Nice greetings


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.

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...