Register    Login    Forum    Search    FAQ

Board index » Misc. » Helpers and Customization




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: onClick... js functions in SO/INV
 Post Posted: Mon May 30, 2011 5:51 am 
Offline

Joined: Mon Feb 14, 2011 2:02 am
Posts: 80
Location: Slovakia
Hi,
I want to add some functions (onClick, OnMouseOver...) into "item_table" html table in orders/invoices. Is there some limitations? These functions are doesnt load on pages. (Code is same in template_main.php for html and in orders.js for js)


Top 
 Profile  
 
 Post subject: Re: onClick... js functions in SO/INV
 Post Posted: Wed Jun 01, 2011 3:18 pm 
Offline

Joined: Fri Oct 26, 2007 3:55 pm
Posts: 3499
Location: Colorado, US
This can be done, what, specifically are you proposing?


Top 
 Profile  
 
 Post subject: Re: onClick... js functions in SO/INV
 Post Posted: Thu Jun 02, 2011 2:34 am 
Offline

Joined: Mon Feb 14, 2011 2:02 am
Posts: 80
Location: Slovakia
I want to highlight item row (or cell) with onClick function. This function working on other pages, but not on orders pages.

for example:
Code:
<script>
var preEl ;
var orgBColor;
var orgTColor;
function HighLightTR(el, backColor,textColor){
  if(typeof(preEl)!='undefined') {
     preEl.bgColor=orgBColor;
     try{ChangeTextColor(preEl,orgTColor);}catch(e){;}
  }
  orgBColor = el.bgColor;
  orgTColor = el.style.color;
  el.bgColor=backColor;

  try{ChangeTextColor(el,textColor);}catch(e){;}
  preEl = el;
}


function ChangeTextColor(a_obj,a_color){  ;
   for (i=0;i<a_obj.cells.length;i++)
    a_obj.cells(i).style.color=a_color;
}
</script>

and in html:
Code:
<tr onClick="HighLightTR(this,'#c9cc99','#cc3333');"></tr> //works with TD also

maybe wrong onClick code in orders.js


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 3 posts ] 

Board index » Misc. » Helpers and Customization


Who is online

Users browsing this forum: No registered users and 1 guest

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: