Link to home
Start Free TrialLog in
Avatar of solunatec
solunatec

asked on

wondering how to integrate a php mysql database call to this example code I found on net

Just wondering if anyone knows how to integrate a php/mysql call for data to this javascript : I am good with the mysql part in terms of making a call for the data I want basically I am looking for how to pass along what i assume would be an array from the call...
Avatar of solunatec
solunatec

ASKER

oops forgot to add the script..
<html>
<head>
  <title>ActiveWidgets Grid :: Examples</title>
  <style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style>

  <!-- ActiveWidgets stylesheet and scripts -->
  <link href="gridRuntime/styles/xp/grid.css" rel="stylesheet" type="text/css" ></link>
  <script src="gridRuntime/lib/grid.js"></script>

  <!-- grid format -->
  <style>
    .active-controls-grid {height: 100%; font: menu;}

    .active-column-0 {width:  80px;}
    .active-column-1 {width: 200px;}
    .active-column-2 {text-align: right;}
    .active-column-3 {text-align: right;}
    .active-column-4 {text-align: right;}

    .active-grid-column {border-right: 1px solid threedlightshadow;}
    .active-grid-row {border-bottom: 1px solid threedlightshadow;}
  </style>

  <!-- grid data -->
  <script>
    var myData = [
      ["MSFT","Microsoft Corporation", "314,571.156", "32,187.000", "55000"],
      ["ORCL", "Oracle Corporation", "62,615.266", "9,519.000", "40650"],
      ["SAP", "SAP AG (ADR)", "40,986.328", "8,296.420", "28961"],
      ["CA", "Computer Associates Inter", "15,606.335", "3,164.000", "16000"],
      ["ERTS", "Electronic Arts Inc.", "14,490.895", "2,503.727", "4000"],
      ["SFTBF", "Softbank Corp. (ADR)", "14,485.840", ".000", "6865"],
      ["VRTS", "Veritas Software Corp.", "14,444.272", "1,578.658", "5647"],
      ["SYMC", "Symantec Corporation", "9,932.483", "1,482.029", "4300"],
      ["INFY", "Infosys Technologies Ltd.", "9,763.851", "830.748", "15400"],
      ["INTU", "Intuit Inc.", "9,702.477", "1,650.743", "6700"],
      ["ADBE", "Adobe Systems Incorporate", "9,533.050", "1,230.817", "3341"],
      ["PSFT", "PeopleSoft, Inc.", "8,246.467", "1,941.167", "8180"],
      ["SEBL", "Siebel Systems, Inc.", "5,434.649", "1,417.952", "5909"],
      ["BEAS", "BEA Systems, Inc.", "5,111.813", "965.694", "3063"],
      ["SNPS", "Synopsys, Inc.", "4,482.535", "1,169.786", "4254"],
      ["CHKP", "Check Point Software Tech", "4,396.853", "424.769", "1203"],
      ["MERQ", "Mercury Interactive Corp.", "4,325.488", "444.063", "1822"],
      ["DOX", "Amdocs Limited", "4,288.017", "1,427.088", "9400"],
      ["CTXS", "Citrix Systems, Inc.", "3,946.485", "554.222", "1670"],
      ["KNM", "Konami Corporation (ADR)", "3,710.784", ".000", "4313"]
    ];

    var myColumns = [
      "Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"
    ];
  </script>
</head>
<body>
  <script>

  //  create ActiveWidgets Grid javascript object
  var obj = new Active.Controls.Grid;

  //  set number of rows/columns
  obj.setRowProperty("count", 20);
  obj.setColumnProperty("count", 5);

  //  provide cells and headers text
  obj.setDataProperty("text", function(i, j){return myData[i][j]});
  obj.setColumnProperty("text", function(i){return myColumns[i]});

  //  set headers width/height
  obj.setRowHeaderWidth("28px");
  obj.setColumnHeaderHeight("20px");

  //  set click action handler
  obj.setAction("click", function(src){window.status = src.getItemProperty("text")});

  //  write grid html to the page
  document.write(obj);

  </script>
</body>
</html>

Open in new window

Something like the attached
<html> 
<head> 
  <title>ActiveWidgets Grid :: Examples</title> 
  <style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style> 
 
  <!-- ActiveWidgets stylesheet and scripts --> 
  <link href="gridRuntime/styles/xp/grid.css" rel="stylesheet" type="text/css" ></link> 
  <script src="gridRuntime/lib/grid.js"></script> 
 
  <!-- grid format --> 
  <style> 
    .active-controls-grid {height: 100%; font: menu;} 
 
    .active-column-0 {width:  80px;} 
    .active-column-1 {width: 200px;} 
    .active-column-2 {text-align: right;} 
    .active-column-3 {text-align: right;} 
    .active-column-4 {text-align: right;} 
 
    .active-grid-column {border-right: 1px solid threedlightshadow;} 
    .active-grid-row {border-bottom: 1px solid threedlightshadow;} 
  </style> 
 
	
  <!-- grid data --> 
  <script> 
    var myData = [ 
	<?php
	//get the data from the db
	$query = "SELECT * FROM some_table";
	$result = mysql_query($query);
	while($row = mysql_fetch_array($result,MYSQL_ASSOC){
      echo '["'.$row['field1'].'","'.$row['field2'].'", "'.$row['field3'].'", "'.$row['field4'].'", "'.$row['field5'].'"],'."\r\n"; 
	} ?>
    ]; 
 
    var myColumns = [ 
      "Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees" 
    ]; 
  </script> 
</head> 
<body> 
  <script> 
 
  //  create ActiveWidgets Grid javascript object 
  var obj = new Active.Controls.Grid; 
 
  //  set number of rows/columns 
  obj.setRowProperty("count", 20); 
  obj.setColumnProperty("count", 5); 
 
  //  provide cells and headers text 
  obj.setDataProperty("text", function(i, j){return myData[i][j]}); 
  obj.setColumnProperty("text", function(i){return myColumns[i]}); 
 
  //  set headers width/height 
  obj.setRowHeaderWidth("28px"); 
  obj.setColumnHeaderHeight("20px"); 
 
  //  set click action handler 
  obj.setAction("click", function(src){window.status = src.getItemProperty("text")}); 
 
  //  write grid html to the page 
  document.write(obj); 
 
  </script> 
</body> 
</html>

Open in new window

thank you ..; only thing is that at line 32 I am getting a  syntax error, being the curly parenthesi at the end of the line: I have an older zend editor.
ASKER CERTIFIED SOLUTION
Avatar of Greg Alexander
Greg Alexander
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That work for you?
thanks..actually i dont know becuase as I said I got this exmaple off the web and I am having trouble with the javascript file that is suppose to work with the code...: here it is in case your interested.
<html> 
<head> 
  <title>ActiveWidgets Grid :: Examples</title> 
  <style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style> 
 
  <!-- ActiveWidgets stylesheet and scripts --> 
  <link href="grid.css" rel="stylesheet" type="text/css" ></link> 
  <script src="grid.js"></script> 
 
  <!-- grid format --> 
  <style> 
    .active-controls-grid {height: 100%; font: menu;} 
 
    .active-column-0 {width:  80px;} 
    .active-column-1 {width: 200px;} 
    .active-column-2 {text-align: right;} 
    .active-column-3 {text-align: right;} 
    .active-column-4 {text-align: right;} 
 
    .active-grid-column {border-right: 1px solid threedlightshadow;} 
    .active-grid-row {border-bottom: 1px solid threedlightshadow;} 
  </style> 
 
	
  <!-- grid data --> 
  <script> 
    var myData=[ 
	<?php
	
	 @ $db = new mysqli('localhost', 'xxxx', 'xxxxxx','xxxxxxxx');

  if (mysqli_connect_errno()) {
     echo 'Error: Could not connect to database.  Please try again later.';
     exit;
  }
 
	
	
	$result=mysqli_query($db,"SELECT * FROM emp_hours");

		while($row=mysql_fetch_array($result,MYSQL_ASSOC)) {
	echo '["'.$row['field1'].'","'.$row['field2'].'","'.$row['field3'].'","'.$row['field4'].'",
       "'.$row['field5'].'","'.$row['field6'].'","'.$row['field7'].'","'.$row['field8'].'","'.$row['field9'].'",
       "'.$row['field10'].'"],'."\r\n"; 
	}
	?>
    ]; 

    var myColumns = [ 
      "todays_date","emp_name","emp_uid","work_order_uid","start_time","end_time",
      "total_hours","pay_out","est_supply_cost","comment" 
    ]; 
  </script> 
</head> 
<body> 
  <script> 
 
  //  create ActiveWidgets Grid javascript object 
  var obj = new Active.Controls.Grid; 
 
  //  set number of rows/columns 
  obj.setRowProperty("count", 20); 
  obj.setColumnProperty("count", 5); 
 
  //  provide cells and headers text 
  obj.setDataProperty("text", function(i, j){return myData[i][j]}); 
  obj.setColumnProperty("text", function(i){return myColumns[i]}); 
 
  //  set headers width/height 
  obj.setRowHeaderWidth("28px"); 
  obj.setColumnHeaderHeight("20px"); 
 
  //  set click action handler 
  obj.setAction("click", function(src){window.status = src.getItemProperty("text")}); 
 
  //  write grid html to the page 
  document.write(obj); 
 
  </script> 
</body> 
</html>

Open in new window

these are the supporting scripts......
/*****************************************************************

	ActiveWidgets Grid 1.0.0 (Free Edition).
	Copyright (C) 2004 ActiveWidgets Ltd. All Rights Reserved. 
	More information at http://www.activewidgets.com/

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*****************************************************************/

 if(!window.Active){var Active={}}if(!Active.System){Active.System={}}if(!Active.HTML){Active.HTML={}}if(!Active.Templates){Active.Templates={}}if(!Active.Formats){Active.Formats={}}if(!Active.HTTP){Active.HTTP={}}if(!Active.Text){Active.Text={}}if(!Active.XML){Active.XML={}}if(!Active.Controls){Active.Controls={}}(function(){if(!window.HTMLElement){return}var element=HTMLElement.prototype;var capture=["click","mousedown","mouseup","mousemove","mouseover","mouseout" ];element.setCapture=function(){var self=this;var flag=false;this._capture=function(event){if(flag){return}flag=true;self.dispatchEvent(event);flag=false};for(var i=0;i<capture.length;i++){window.addEventListener(capture[i],this._capture,true);window.captureEvents(Event[capture[i]])}};element.releaseCapture=function(){for(var i=0;i<capture.length;i++){window.releaseEvents(Event[capture[i]]);window.removeEventListener(capture[i],this._capture,true)}this._capture=null};element.attachEvent=function(name,handler){if(typeof handler !="function"){return}var nsName=name.replace(/^on/,"");var nsHandler=function(event){window.event=event;handler();window.event=null};handler[name]=nsHandler;this.addEventListener(nsName,nsHandler,false)};element.detachEvent=function(name,handler){if(typeof handler !="function"){return}var nsName=name.replace(/^on/,"");this.removeEventListener(nsName,handler[name],false);handler[name]=null};var getClientWidth=function(){return this.offsetWidth - 20};var getClientHeight=function(){return this.offsetHeight - 20};element.__defineGetter__("clientWidth",getClientWidth);element.__defineGetter__("clientHeight",getClientHeight);var getRuntimeStyle=function(){return this.style};element.__defineGetter__("runtimeStyle",getRuntimeStyle);var cs=ComputedCSSStyleDeclaration.prototype;cs.__defineGetter__("paddingTop",function(){return this.getPropertyValue("padding-top")});var getCurrentStyle=function(){return document.defaultView.getComputedStyle(this,"")};element.__defineGetter__("currentStyle",getCurrentStyle);var setOuterHtml=function(s){var range=this.ownerDocument.createRange();range.setStartBefore(this);var fragment=range.createContextualFragment(s);this.parentNode.replaceChild(fragment,this)};element.__defineSetter__("outerHTML",setOuterHtml)})();(function(){if(!window.Event){return}var event=Event.prototype;if(!event){return}var getSrcElement=function(){return(this.target.nodeType==3)?this.target.parentNode:this.target};event.__defineGetter__("srcElement",getSrcElement);var setReturnValue=function(value){if(!value){this.preventDefault()}};event.__defineSetter__("returnValue",setReturnValue)})();(function(){if(!window.CSSStyleSheet){return}var stylesheet=CSSStyleSheet.prototype;stylesheet.addRule=function(selector,rule){this.insertRule(selector+"{"+rule+"}",this.cssRules.length)};stylesheet.__defineGetter__("rules",function(){return this.cssRules})})();(function(){if(!window.XMLHttpRequest){return}var ActiveXObject=function(type){ActiveXObject[type](this)};ActiveXObject["MSXML2.DOMDocument"]=function(obj){obj.setProperty=function(){};obj.load=function(url){var xml=this;var async=this.async?true:false;var request=new XMLHttpRequest();request.open("GET",url,async);request.overrideMimeType("text/xml");if(async){request.onreadystatechange=function(){xml.readyState=request.readyState;if(request.readyState==4){xml.documentElement=request.responseXML.documentElement;xml.firstChild=xml.documentElement;request.onreadystatechange=null}if(xml.onreadystatechange){xml.onreadystatechange()}}}this.parseError={errorCode:0,reason:"Emulation"};request.send(null);this.readyState=request.readyState;if(request.responseXML && !async){this.documentElement=request.responseXML.documentElement;this.firstChild=this.documentElement}}};ActiveXObject["MSXML2.XMLHTTP"]=function(obj){obj.open=function(method,url,async){this.request=new XMLHttpRequest();this.request.open(method,url,async)};obj.send=function(data){this.request.send(data)};obj.setRequestHeader=function(name,value){this.request.setRequestHeader(name,value)};obj.__defineGetter__("readyState",function(){return this.request.readyState});obj.__defineGetter__("responseXML",function(){return this.request.responseXML});obj.__defineGetter__("responseText",function(){return this.request.responseText})}})();(function(){if(!window.XPathEvaluator){return}var xpath=new XPathEvaluator();var element=Element.prototype;var attribute=Attr.prototype;var doc=Document.prototype;doc.loadXML=function(text){var parser=new DOMParser;var newDoc=parser.parseFromString(text,"text/xml");this.replaceChild(newDoc.documentElement,this.documentElement)};doc.setProperty=function(name,value){if(name=="SelectionNamespaces"){namespaces={};var a=value.split(" xmlns:");for(var i=1;i<a.length;i++){var s=a[i].split("=");namespaces[s[0]]=s[1].replace(/\"/g,"")}this._ns={lookupNamespaceURI:function(prefix){return namespaces[prefix]}}}};doc._ns={lookupNamespaceURI:function(){return null}};doc.selectNodes=function(path){var result=xpath.evaluate(path,this,this._ns,7,null);var i,nodes=[];for(i=0;i<result.snapshotLength;i++){nodes[i]=result.snapshotItem(i)}return nodes};doc.selectSingleNode=function(path){return xpath.evaluate(path,this,this._ns,9,null).singleNodeValue};element.selectNodes=function(path){var result=xpath.evaluate(path,this,this.ownerDocument._ns,7,null);var i,nodes=[];for(i=0;i<result.snapshotLength;i++){nodes[i]=result.snapshotItem(i)}return nodes};element.selectSingleNode=function(path){return xpath.evaluate(path,this,this.ownerDocument._ns,9,null).singleNodeValue};element.__defineGetter__("text",function(){return this.firstChild.nodeValue});attribute.__defineGetter__("text",function(){return this.nodeValue})})(); Active.System.Object=function(){};Active.System.Object.subclass=function(){var constructor=function(){this.init()};for(var i in this){constructor[i]=this[i]}constructor.prototype=new this();constructor.superclass=this;return constructor};Active.System.Object.handle=function(error){throw(error)};Active.System.Object.create=function(){var obj=this.prototype;obj.clone=function(){if(this._clone.prototype!==this){this._clone=function(){this.init()};this._clone.prototype=this}return new this._clone()};obj._clone=function(){};obj.init=function(){};obj.handle=function(error){throw(error)};obj.timeout=function(handler,delay){var self=this;var wrapper=function(){handler.call(self)};return window.setTimeout(wrapper,delay?delay:0)};obj.toString=function(){return ""}};Active.System.Object.create(); Active.System.Model=Active.System.Object.subclass();Active.System.Model.create=function(){var obj=this.prototype;var join=function(){var i,s=arguments[0];for(i=1;i<arguments.length;i++){s+=arguments[i].substr(0,1).toUpperCase()+arguments[i].substr(1)}return s};obj.defineProperty=function(name,value){var _getProperty=join("get",name);var _setProperty=join("set",name);var _property="_"+name;var getProperty=function(){return this[_property]};this[_setProperty]=function(value){if(typeof value=="function"){this[_getProperty]=value}else{this[_getProperty]=getProperty;this[_property]=value}};this[_setProperty](value)};var get={};var set={};obj.getProperty=function(name,a,b,c){if(!get[name]){get[name]=join("get",name)}return this[get[name]](a,b,c)};obj.setProperty=function(name,value,a,b,c){if(!set[name]){set[name]=join("set",name)}return this[set[name]](value,a,b,c)};obj.isReady=function(){return true}};Active.System.Model.create(); Active.System.Format=Active.System.Object.subclass();Active.System.Format.create=function(){var obj=this.prototype;obj.valueToText=function(value){return value};obj.dataToValue=function(data){return data};obj.dataToText=function(data){var value=this.dataToValue(data);return this.valueToText(value)};obj.setErrorText=function(text){this._textError=text};obj.setErrorValue=function(value){this._valueError=value};obj.setErrorText("#ERR");obj.setErrorValue(NaN)};Active.System.Format.create(); Active.System.HTML=Active.System.Object.subclass();Active.System.HTML.create=function(){var obj=this.prototype;obj.setTag=function(tag){this._tag=tag};obj.getTag=function(){return this._tag};obj._tag="div";obj.init=function(){if(this.$owner){return}if(this._parent){return}this._id="tag"+this.all.id++;this.all[this._id]=this};obj.getId=function(){return this._id};obj._id="";obj.all=Active.System.all={id:0};obj.setId=function(id){this._id=id;this.all[this._id]=this};obj.element=function(){var i,docs=this._docs,id=this.getId(),e;for(i=0;i<docs.length;i++){e=docs[i].getElementById(id);if(e){return e}}};obj._docs=[document];obj.getClass=function(name){var param="_"+name+"Class";var value=this[param];return typeof(value)=="function"?value.call(this):value};obj.setClass=function(name,value){var element=this.element();if(element){var v=(typeof(value)=="function")?value.call(this):value;element.className=element.className.replace(new RegExp("(active-"+name+"-\\w+|$)")," active-"+name+"-"+v+" ");if(this.$index !==""){return}}if(this.data){return}var param="_"+name+"Class";if(this[param]==null){this._classes+=" "+name}this[param]=value;this._outerHTML=""};obj.refreshClasses=function(){var element=this.element();if(!element){return}var s="",classes=this._classes.split(" ");for(var i=1;i<classes.length;i++){var name=classes[i];var value=this["_"+name+"Class"];if(typeof(value)=="function"){value=value.call(this)}s+="active-"+name+"-"+value+" "}element.className=s+this.$browser};obj._classes="";obj.getStyle=function(name){var param="_"+name+"Style";var value=this[param];return typeof(value)=="function"?value.call(this):value};obj.setStyle=function(name,value){var element=this.element();if(element){element.style[name]=value}if(this.data){return}var param="_"+name+"Style";if(this[param]==null){this._styles+=" "+name}this[param]=value;this._outerHTML=""};obj._styles="";obj.getAttribute=function(name){try{var param="_"+name+"Attribute";var value=this[param];return typeof(value)=="function"?value.call(this):value}catch(error){this.handle(error)}};obj.setAttribute=function(name,value){try{var param="_"+name+"Attribute";if(typeof this[param]=="undefined"){this._attributes+=" "+name}if(specialAttributes[name] &&(typeof value=="function")){this[param]=function(){return value.call(this)?true:null}}else{this[param]=value}this._outerHTML=""}catch(error){this.handle(error)}};obj._attributes="";var specialAttributes={checked:true,disabled:true,hidefocus:true,readonly:true};obj.getEvent=function(name){try{var param="_"+name+"Event";var value=this[param];return value}catch(error){this.handle(error)}};obj.setEvent=function(name,value){try{var param="_"+name+"Event";if(this[param]==null){this._events+=" "+name}this[param]=value;this._outerHTML=""}catch(error){this.handle(error)}};obj._events="";obj.getContent=function(name){try{var split=name.match(/^(\w+)\W(.+)$/);if(split){var ref=this.getContent(split[1]);return ref.getContent(split[2])}else{var param="_"+name+"Content";var value=this[param];if((typeof value=="object")&&(value._parent !=this)){value=value.clone();value._parent=this;value._id=this._id+"/"+name;this[param]=value}return value}}catch(error){this.handle(error)}};obj.setContent=function(name,value){try{if(arguments.length==1){this._content="";if(typeof name=="object"){for(var i in name){if(typeof(i)=="string"){this.setContent(i,name[i])}}}else{this.setContent("html",name)}}else{var split=name.match(/^(\w+)\W(.+)$/);if(split){var ref=this.getContent(split[1]);ref.setContent(split[2],value);this._innerHTML="";this._outerHTML=""}else{var param="_"+name+"Content";if(this[param]==null){this._content+=" "+name}if(typeof value=="object"){value._parent=this;value._id=this._id+"/"+name}this[param]=value;this._innerHTML="";this._outerHTML=""}}}catch(error){this.handle(error)}};obj._content="";obj.$index="";var getParamStr=function(i){return "{#"+i+"}"};obj.innerHTML=function(){try{if(this._innerHTML){return this._innerHTML}this._innerParamLength=0;var i,j,name,value,param1,param2,html,item,s="";var content=this._content.split(" ");for(i=1;i<content.length;i++){name=content[i];value=this["_"+name+"Content"];if(typeof(value)=="function"){param=getParamStr(this._innerParamLength++);this[param]=value;s+=param}else if(typeof(value)=="object"){item=value;html=item.outerHTML().replace(/\{id\}/g,"{id}/"+name);for(j=item._outerParamLength-1;j>=0;j--){param1=getParamStr(j);param2=getParamStr(this._innerParamLength+j);if(param1 !=param2){html=html.replace(param1,param2)}this[param2]=item[param1]}this._innerParamLength+=item._outerParamLength;s+=html}else{s+=value}}this._innerHTML=s;return s}catch(error){this.handle(error)}};obj.outerHTML=function(){try{if(this._outerHTML){return this._outerHTML}var innerHTML=this.innerHTML();this._outerParamLength=this._innerParamLength;if(!this._tag){return innerHTML}var i,tmp,name,value,param;var html="<"+this._tag+" id=\"{id}\"";tmp="";var classes=this._classes.split(" ");for(i=1;i<classes.length;i++){name=classes[i];value=this["_"+name+"Class"];if(typeof(value)=="function"){param=getParamStr(this._outerParamLength++);this[param]=value;value=param}tmp+="active-"+name+"-"+value+" "}if(tmp){html+=" class=\""+tmp+this.$browser+"\""}tmp="";var styles=this._styles.split(" ");for(i=1;i<styles.length;i++){name=styles[i];value=this["_"+name+"Style"];if(typeof(value)=="function"){param=getParamStr(this._outerParamLength++);this[param]=value;value=param}tmp+=name+":"+value+";"}if(tmp){html+=" style=\""+tmp+"\""}tmp="";var attributes=this._attributes.split(" ");for(i=1;i<attributes.length;i++){name=attributes[i];value=this["_"+name+"Attribute"];if(typeof(value)=="function"){param=getParamStr(this._outerParamLength++);this[param]=value;value=param}else if(specialAttributes[name] && !value){value=null}if(value !==null){tmp+=" "+name+"=\""+value+"\""}}html+=tmp;tmp="";var events=this._events.split(" ");for(i=1;i<events.length;i++){name=events[i];value=this["_"+name+"Event"];if(typeof(value)=="function"){value="dispatch(event,this)"}tmp+=" "+name+"=\""+value+"\""}html+=tmp;html+=">"+innerHTML+"</"+this._tag+">";this._outerHTML=html;return html}catch(error){this.handle(error)}};obj.toString=function(){try{var i,s=this._outerHTML;if(!s){s=this.outerHTML()}s=s.replace(/\{id\}/g,this.getId());var max=this._outerParamLength;for(i=0;i<max;i++){var param="{#"+i+"}";var value=this[param]();if(value===null){value="";param=specialParams[i];if(!param){param=getSpecialParamStr(i)}}s=s.replace(param,value)}return s}catch(error){this.handle(error)}};var specialParams=[];function getSpecialParamStr(i){return(specialParams[i]=new RegExp("[\\w\\x2D]*=?:?\\x22?\\{#"+i+"\\}[;\\x22]?"))}obj.refresh=function(){try{var element=this.element();if(element){element.outerHTML=this.toString()}}catch(error){this.handle(error)}};obj.$browser="";if(window.__defineGetter__){obj.$browser="gecko"}if(navigator.userAgent.match("Opera")){obj.$browser="opera"}if(navigator.userAgent.match("Konqueror")){obj.$browser="khtml"}if(navigator.userAgent.match("KHTML")){obj.$browser="khtml"}};Active.System.HTML.create();var dispatch=function(event,element){var parts=element.id.split("/");var tag=parts[0].split(".");var obj=Active.System.all[tag[0]];var type="_on"+event.type+"Event";var i;for(i=1;i<tag.length;i++){var params=tag[i].split(":");obj=obj.getTemplate.apply(obj,params)}var target=obj;for(i=1;i<parts.length;i++){target=target.getContent(parts[i])}if(window.HTMLElement){window.event=event}target[type].call(obj,event);if(window.HTMLElement){window.event=null}return};var mouseover=function(element,name){try{element.className+=" "+name}catch(error){}};var mouseout=function(element,name){try{element.className=element.className.replace(RegExp(" "+name,"g"),"")}catch(error){}}; Active.System.Template=Active.System.HTML.subclass();Active.System.Template.create=function(){var obj=this.prototype;var _super=this.superclass.prototype;var _pattern=/^(\w+)\W(.+)$/;var join=function(){var i,s=arguments[0];for(i=1;i<arguments.length;i++){s+=arguments[i].substr(0,1).toUpperCase()+arguments[i].substr(1)}return s};obj.getProperty=function(name,a,b,c){if(name.match(_pattern)){var getProperty=join("get",RegExp.$1,"property");if(this[getProperty]){return this[getProperty](RegExp.$2,a,b,c)}}};obj.setProperty=function(name,value,a,b,c){if(name.match(_pattern)){var setProperty=join("set",RegExp.$1,"property");if(this[setProperty]){return this[setProperty](RegExp.$2,value,a,b,c)}}};obj.getModel=function(name){var getModel=join("get",name,"model");return this[getModel]()};obj.setModel=function(name,model){var setModel=join("set",name,"model");return this[setModel](model)};obj.defineTemplate=function(name,template){var ref="_"+name+"Template";var get=join("get",name,"template");var set=join("set",name,"template");var getDefault=join("default",name,"template");var name1="."+name;var name2="."+name+":";this[get]=this[getDefault]=function(index){if(typeof(this[ref])=="function"){return this[ref].call(this,index)}if(this[ref].$owner !=this){this[set](this[ref].clone())}if(typeof(index)=="undefined"){this[ref]._id=this._id+name1}else{this[ref]._id=this._id+name2+index}this[ref].$index=index;return this[ref]};obj[get]=function(a,b,c){return this.$owner[get](a,b,c)};obj[set]=function(template){this[ref]=template;if(template){template.$owner=this}};this[set](template)};obj.getTemplate=function(name){if(name.match(_pattern)){var get=join("get",RegExp.$1,"template");arguments[0]=RegExp.$2;var template=this[get]();return template.getTemplate.apply(template,arguments)}else{get=join("get",name,"template");var i,args=[];for(i=1;i<arguments.length;i++){args[i-1]=arguments[i]}return this[get].apply(this,args)}};obj.setTemplate=function(name,template,index){if(name.match(_pattern)){var get=join("get",RegExp.$1,"template");var n=RegExp.$2;this[get]().setTemplate(n,template,index)}else{var set=join("set",name,"template");this[set](template,index)}};obj.getAction=function(name){return this["_"+name+"Action"]};obj.setAction=function(name,value){this["_"+name+"Action"]=value};obj.action=function(name,source,a,b,c){if(typeof source=="undefined"){source=this}var action=this["_"+name+"Action"];if(typeof(action)=="function"){action.call(this,source,a,b,c)}else if(this.$owner){this.$owner.action(name,source,a,b,c)}}};Active.System.Template.create(); Active.System.Control=Active.System.Template.subclass();Active.System.Control.create=function(){var obj=this.prototype;var _super=this.superclass.prototype;var _pattern=/^(\w+)\W(.+)$/;var join=function(){var i,s=arguments[0];for(i=1;i<arguments.length;i++){s+=arguments[i].substr(0,1).toUpperCase()+arguments[i].substr(1)}return s};obj.setEvent("oncontextmenu","return false");obj.setEvent("onselectstart","return false");obj.defineModel=function(name){var external="_"+name+"Model";var defineProperty=join("define",name,"property");var definePropertyArray=join("define",name,"property","array");var getProperty=join("get",name,"property");var setProperty=join("set",name,"property");var get={};var set={};var getModel=join("get",name,"model");var setModel=join("set",name,"model");var updateModel=join("update",name,"model");this[defineProperty]=function(property,defaultValue){var _getProperty=join("get",name,property);var _setProperty=join("set",name,property);var _property="_"+join(name,property);var getPropertyMethod=function(){return this[_property]};this[_getProperty]=getPropertyMethod;this[_setProperty]=function(value){if(typeof value=="function"){this[_getProperty]=value}else{if(this[_getProperty] !==getPropertyMethod){this[_getProperty]=getPropertyMethod}this[_property]=value}this[updateModel](property)};this[_setProperty](defaultValue)};this[getProperty]=function(property,a,b,c){try{if(this[external]){return this[external].getProperty(property,a,b,c)}if(!get[property]){get[property]=join("get",name,property)}return this[get[property]](a,b,c)}catch(error){return this.handle(error)}};this[setProperty]=function(property,value,a,b,c){try{if(this[external]){return this[external].setProperty(property,value,a,b,c)}if(!set[property]){set[property]=join("set",name,property)}return this[set[property]](value,a,b,c)}catch(error){return this.handle(error)}};_super[getProperty]=function(property,a,b,c){if(this[external]){return this[external].getProperty(property,a,b,c)}return this.$owner[getProperty](property,a,b,c)};_super[setProperty]=function(property,value,a,b,c){if(this[external]){return this[external].setProperty(property,value,a,b,c)}return this.$owner[setProperty](property,value,a,b,c)};this[definePropertyArray]=function(property,defaultValue){var _getProperty=join("get",name,property);var _setProperty=join("set",name,property);var _getArray=join("get",name,property+"s");var _setArray=join("set",name,property+"s");var _array="_"+join(name,property+"s");var _getCount=join("get",name,"count");var _setCount=join("set",name,"count");var getArrayElement=function(index){return this[_array][index]};var getStaticElement=function(){return this[_array]};var getArray=function(){return this[_array].concat()};var getTempArray=function(){var i,a=[],max=this[_getCount]();for(i=0;i<max;i++){a[i]=this[_getProperty](i)}return a};this[_setProperty]=function(value,index){if(typeof value=="function"){this[_getProperty]=value;this[_getArray]=getTempArray}else if(arguments.length==1){this[_array]=value;this[_getProperty]=getStaticElement;this[_getArray]=getTempArray}else{if(this[_getArray] !=getArray){this[_array]=this[_getArray]()}this[_array][index]=value;this[_getProperty]=getArrayElement;this[_getArray]=getArray}this[updateModel](property)};this[_setArray]=function(value){if(typeof value=="function"){this[_getArray]=value}else{this[_array]=value.concat();this[_getProperty]=getArrayElement;this[_getArray]=getArray;this[_setCount](value.length)}this[updateModel](property)};this[_setProperty](defaultValue)};var proxyPrototype=new Active.System.Model;proxyPrototype.getProperty=function(property,a,b,c){return this._target[getProperty](property,a,b,c)};proxyPrototype.setProperty=function(property,value,a,b,c){return this._target[setProperty](property,value,a,b,c)};var proxy=join("_",name,"proxy");this[getModel]=function(){if(this[external]){return this[external]}if(!this[proxy]){this[proxy]=proxyPrototype.clone();this[proxy]._target=this;this[proxy].$owner=this.$owner}return this[proxy]};_super[setModel]=function(model){this[external]=model;if(model && !model.$owner){model.$owner=this}};_super[getModel]=function(a,b,c){if(this[external]){return this[external]}return this.$owner[getModel](a,b,c)};this[updateModel]=function(){}};obj.defineProperty=function(name,defaultValue){if(name.match(_pattern)){var defineProperty=join("define",RegExp.$1,"property");if(this[defineProperty]){return this[defineProperty](RegExp.$2,defaultValue)}}};obj.definePropertyArray=function(name,defaultValue){if(name.match(_pattern)){var defineArray=join("define",RegExp.$1,"property","array");if(this[defineArray]){return this[defineArray](RegExp.$2,defaultValue)}}}};Active.System.Control.create(); Active.Formats.String=Active.System.Format.subclass();Active.Formats.String.create=function(){var obj=this.prototype;obj.dataToValue=function(data){return data.toUpperCase()};obj.dataToText=function(data){return data}};Active.Formats.String.create(); Active.Formats.Number=Active.System.Format.subclass();Active.Formats.Number.create=function(){var obj=this.prototype;obj.dataToValue=function(data){return Number(data)};var noFormat=function(value){return ""+value};var doFormat=function(value){var multiplier=this._multiplier;var abs=(value<0)?-value:value;var delta=(value<0)?-0.5:+0.5;var rounded=(Math.round(value * multiplier)+delta)/multiplier+"";if(abs<1000){return rounded.replace(this.p1,this.r1)}if(abs<1000000){return rounded.replace(this.p2,this.r2)}if(abs<1000000000){return rounded.replace(this.p3,this.r3)}return rounded.replace(this.p4,this.r4)};obj.setTextFormat=function(format)
 {var pattern=/^([^0#]*)([0#]*)([ .,]?)([0#]|[0#]{3})([.,])([0#]*)([^0#]*)$/;var f=format.match(pattern);
 
 if(!f){this.valueToText=noFormat;return}this.valueToText=doFormat;var rs=f[1];var rg=f[3];var rd=f[5];var re=f[7];var decimals=f[6].length;this._multiplier=Math.pow(10,decimals);var ps="^(-?\\d+)",pm="(\\d{3})",pe="\\.(\\d{"+decimals+"})\\d$";this.p1=new RegExp(ps+pe);this.p2=new RegExp(ps+pm+pe);this.p3=new RegExp(ps+pm+pm+pe);this.p4=new RegExp(ps+pm+pm+pm+pe);this.r1=rs+"$1"+rd+"$2"+re;this.r2=rs+"$1"+rg+"$2"+rd+"$3"+re;this.r3=rs+"$1"+rg+"$2"+rg+"$3"+rd+"$4"+re;this.r4=rs+"$1"+rg+"$2"+rg+"$3"+rg+"$4"+rd+"$5"+re};obj.setTextFormat("#.##")};Active.Formats.Number.create(); Active.Formats.Date=Active.System.Format.subclass();Active.Formats.Date.create=function(){var obj=this.prototype;obj.date=new Date();obj.digits=[];obj.shortMonths=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];obj.longMonths=["January","February","March","April","May","June","July","August","September","October","November","December"];obj.shortWeekdays=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];obj.longWeekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];for(var i=0;i<100;i++){obj.digits[i]=i<10?"0"+i:""+i}var tokens={"hh":"this.digits[this.date.getUTCHours()]",":mm":"':'+this.digits[this.date.getUTCMinutes()]","mm:":"this.digits[this.date.getUTCMinutes()]+':'","ss":"this.digits[this.date.getUTCSeconds()]","dddd":"this.longWeekdays[this.date.getUTCDay()]","ddd":"this.shortWeekdays[this.date.getUTCDay()]","dd":"this.digits[this.date.getUTCDate()]","d":"this.date.getUTCDate()","mmmm":"this.longMonths[this.date.getUTCMonth()]","mmm":"this.shortMonths[this.date.getUTCMonth()]","mm":"this.digits[this.date.getUTCMonth()]","m":"this.date.getUTCMonth()","yyyy":"this.date.getUTCFullYear()","yy":"this.digits[this.date.getUTCFullYear()%100]"};var match="";for(i in tokens){if(typeof(i)=="string"){match+="|"+i}}var re=new RegExp(match.replace("|","(")+")","gi");obj.setTextFormat=function(format){format=format.replace(re,function(i){return "'+"+tokens[i.toLowerCase()]+"+'"});format="if(isNaN(value))return this._textError;"+"this.date.setTime(value+this._textTimezoneOffset);"+("return '"+format+"'").replace(/(''\+|\+'')/g,"");this.valueToText=new Function("value",format)};var xmlExpr=/^(....).(..).(..).(..).(..).(..)........(...).(..)/;var xmlOut="$1/$2/$3 $4:$5:$6 GMT$7$8";var auto=function(data){return Date.parse(data+this._dataTimezoneCode)};var RFC822=function(data){return Date.parse(data)};var ISO8061=function(data){return Date.parse(data.replace(xmlExpr,xmlOut))};obj.setDataFormat=function(format){if(format=="RFC822"){this.dataToValue=RFC822}else if(format=="ISO8061"){this.dataToValue=ISO8061}else{this.dataToValue=auto}};obj.setTextTimezone=function(value){this._textTimezoneOffset=value};obj.setDataTimezone=function(value){if(!value){this._dataTimezoneCode=" GMT"}else{this._dataTimezoneCode=" GMT"+(value>0?"+":"-")+this.digits[Math.floor(Math.abs(value/3600000))]+this.digits[Math.abs(value/60000)%60]}};var localTimezone=- obj.date.getTimezoneOffset()* 60000;obj.setTextTimezone(localTimezone);obj.setDataTimezone(localTimezone);obj.setTextFormat("d mmm yy");obj.setDataFormat("default")};Active.Formats.Date.create(); Active.HTML.define=function(name,tag,type){if(!tag){tag=name.toLowerCase()}Active.HTML[name]=Active.System.HTML.subclass();Active.HTML[name].create=function(){};Active.HTML[name].prototype.setTag(tag)};Active.HTML.define("DIV");Active.HTML.define("SPAN");Active.HTML.define("IMG");Active.HTML.define("INPUT");Active.HTML.define("BUTTON");Active.HTML.define("TEXTAREA");Active.HTML.define("TABLE");Active.HTML.define("TR");Active.HTML.define("TD"); Active.Templates.Status=Active.System.Template.subclass();Active.Templates.Status.create=function(){var obj=this.prototype;obj.setClass("templates","status");var image=new Active.HTML.SPAN;image.setClass("box","image");image.setClass("image",function(){return this.getStatusProperty("image")});obj.setContent("image",image);obj.setContent("text",function(){return this.getStatusProperty("text")})};Active.Templates.Status.create(); Active.Templates.Error=Active.System.Template.subclass();Active.Templates.Error.create=function(){var obj=this.prototype;obj.setClass("templates","error");obj.setContent("title","Error:");obj.setContent("text",function(){return this.getErrorProperty("text")})};Active.Templates.Error.create(); Active.Templates.Text=Active.System.Template.subclass();Active.Templates.Text.create=function(){var obj=this.prototype;obj.setClass("templates","text");obj.setContent("text",function(){return this.getItemProperty("text")});obj.setEvent("onclick",function(){this.action("click")})};Active.Templates.Text.create(); Active.Templates.Image=Active.System.Template.subclass();Active.Templates.Image.create=function(){var obj=this.prototype;obj.setClass("templates","image");var image=new Active.HTML.SPAN;image.setClass("box","image");image.setClass("image",function(){return this.getItemProperty("image")});obj.setContent("image",image);obj.setContent("text",function(){return this.getItemProperty("text")});obj.setEvent("onclick",function(){this.action("click")})};Active.Templates.Image.create(); Active.Templates.Link=Active.System.Template.subclass();Active.Templates.Link.create=function(){var obj=this.prototype;obj.setTag("a");obj.setClass("templates","link");obj.setAttribute("href",function(){return this.getItemProperty("link")});var image=new Active.HTML.SPAN;image.setClass("box","image");image.setClass("image",function(){return this.getItemProperty("image")});obj.setContent("image",image);obj.setContent("text",function(){return this.getItemProperty("text")});obj.setEvent("onclick",function(){this.action("click")})};Active.Templates.Link.create(); Active.Templates.Item=Active.System.Template.subclass();Active.Templates.Item.create=function(){var obj=this.prototype;obj.setClass("templates","item");obj.setClass("box","normal");var box=new Active.HTML.DIV;var image=new Active.HTML.SPAN;box.setClass("box","item");image.setClass("box","image");image.setClass("image",function(){return this.getItemProperty("image")});obj.setContent("box",box);obj.setContent("box/image",image);obj.setContent("box/text",function(){return this.getItemProperty("text")})};Active.Templates.Item.create(); Active.Templates.List=Active.System.Template.subclass();Active.Templates.List.create=function(){var obj=this.prototype;obj.setTag("");obj.defineTemplate("item",new Active.Templates.Text);var getItemProperty=function(property){return this.$owner.getDataProperty(property,this.$index)};var setItemProperty=function(property,value){return this.$owner.setDataProperty(property,value,this.$index)};obj.getItemTemplate=function(index,temp){var template=this.defaultItemTemplate(index);if(!temp){temp=[]}if(!temp.selected){temp.selected=[];var i,values=this.getSelectionProperty("values");for(i=0;i<values.length;i++){temp.selected[values[i]]=true}template.getItemProperty=getItemProperty;template.setItemProperty=setItemProperty;template.setClass("list","item")}if(temp.selected[index]){template=template.clone();template.$index="";template.setClass("selection",true);template.$index=index}return template};var html=function(){var i,result=[],temp=[],items=this.getItemsProperty("values");for(i=0;i<items.length;i++){result[i]=this.getItemTemplate(items[i],temp).toString()}return result.join("")};obj.setContent("html",html)};Active.Templates.List.create(); Active.Templates.Row=Active.Templates.List.subclass();Active.Templates.Row.create=function(){var obj=this.prototype;var _super=this.superclass.prototype;obj.setTag("div");obj.setClass("templates","row");obj.setClass("grid","row");obj.getDataProperty=function(property,i){return this.$owner.getDataProperty(property,this.$index,i)};obj.setDataProperty=function(property,value,i){return this.$owner.setDataProperty(property,value,this.$index,i)};obj.getItemsProperty=function(property){return this.getColumnProperty(property)};obj.getSelectionProperty=function(property){return this.getDummyProperty(property)};obj.getRowProperty=function(property){return this.$owner.getItemsProperty(property,this.$index)};var getItemProperty=function(property){return this.$owner.getDataProperty(property,this.$index)};var setItemProperty=function(property,value){return this.$owner.setDataProperty(property,value,this.$index)};var getColumnProperty=function(property){return this.$owner.getColumnProperty(property,this.$index)};obj.getItemTemplate=function(i){if(!this._itemTemplates){this._itemTemplates=[]}if(this._itemTemplates[i]){this._itemTemplates[i]._id=this._id+".item:"+i;return this._itemTemplates[i]}if(typeof(i)=="undefined"){return _super.getItemTemplate.call(this)}var template=_super.getItemTemplate.call(this,i).clone();template.$index=i;template.setClass("column",i);this._itemTemplates[i]=template;return template};obj.setItemTemplate=function(template,i){template.getItemProperty=getItemProperty;template.setItemProperty=setItemProperty;template.getColumnProperty=getColumnProperty;template.setClass("row","cell");template.setClass("grid","column");if(typeof(i)=="undefined"){return _super.setItemTemplate.call(this,template)}template.setClass("column",i);template.$owner=this;template.$index=i;if(!this._itemTemplates){this._itemTemplates=[]}this._itemTemplates[i]=template};var selectRow=function(event){if(event.shiftKey){return this.action("selectRangeOfRows")}if(event.ctrlKey){return this.action("selectMultipleRows")}this.action("selectRow")};obj.setEvent("onclick",selectRow)};Active.Templates.Row.create(); Active.Templates.Header=Active.Templates.Item.subclass();Active.Templates.Header.create=function(){var obj=this.prototype;obj.setClass("templates","header");obj.setClass("column",function(){return this.$index});obj.setClass("sort",function(){return this.getSortProperty("index")!=this.$index?"none":this.getSortProperty("direction")});obj.setAttribute("title",function(){return this.getItemProperty("tooltip")});var div=new Active.HTML.DIV;div.setClass("box","resize");div.setEvent("onmousedown",function(){this.action("startColumnResize")});div.setContent("html","&nbsp;");obj.setContent("div",div);obj.setEvent("onmousedown",function(){this.setClass("header","pressed");window.status="Sorting...";this.timeout(function(){this.action("columnSort")})});var sort=new Active.HTML.SPAN;sort.setClass("box","sort");obj.setContent("box/sort",sort);obj.setEvent("onmouseenter","mouseover(this,'active-header-over')");obj.setEvent("onmouseleave","mouseout(this,'active-header-over')")};Active.Templates.Header.create(); Active.Templates.Box=Active.System.Template.subclass();Active.Templates.Box.create=function(){var obj=this.prototype;obj.setClass("templates","box");obj.setClass("box","normal");var box=new Active.HTML.DIV;box.setClass("box","item");obj.setContent("box",box)};Active.Templates.Box.create(); Active.Templates.Scroll=Active.System.Template.subclass();Active.Templates.Scroll.create=function(){var obj=this.prototype;var _super=this.superclass.prototype;obj.setTag("");var Pane=Active.HTML.DIV;var Box=Active.Templates.Box;var data=new Pane;var top=new Pane;var left=new Pane;var corner=new Box;var fill=new Box;var scrollbars=new Pane;var space=new Pane;data.setClass("scroll","data");top.setClass("scroll","top");left.setClass("scroll","left");corner.setClass("scroll","corner");fill.setClass("scroll","fill");scrollbars.setClass("scroll","bars");space.setClass("scroll","space");obj.setContent("data",data);obj.setContent("top",top);obj.setContent("left",left);obj.setContent("corner",corner);obj.setContent("scrollbars",scrollbars);obj.setContent("data/html",function(){return this.getMainTemplate()});obj.setContent("top/html",function(){return this.getTopTemplate()});obj.setContent("left/html",function(){return this.getLeftTemplate()});obj.setContent("scrollbars/space",space);obj.setContent("top/fill",fill);var scroll=function(){var scrollbars=this.getContent("scrollbars").element();var data=this.getContent("data").element();var top=this.getContent("top").element();var left=this.getContent("left").element();var x=scrollbars.scrollLeft;var y=scrollbars.scrollTop;data.scrollLeft=x;top.scrollLeft=x;data.scrollTop=y;left.scrollTop=y;scrollbars=null;data=null;top=null;left=null};scrollbars.setEvent("onscroll",scroll);var resize=function(){if(this._sizeAdjusted){this._sizeAdjusted=false;this.timeout(adjustSize,100);var data=this.getContent("data").element();var scrollbars=this.getContent("scrollbars").element();var top=this.getContent("top").element();var left=this.getContent("left").element();data.runtimeStyle.width="100%";top.runtimeStyle.width="100%";data.runtimeStyle.height="100%";left.runtimeStyle.height="100%";scrollbars.runtimeStyle.zIndex=1000;data=null;scrollbars=null;top=null;left=null}};scrollbars.setEvent("onresize",resize);obj._sizeAdjusted=true;var adjustSize=function(){var data=this.getContent("data").element();var scrollbars=this.getContent("scrollbars").element();var top=this.getContent("top").element();var left=this.getContent("left").element();var space=this.getContent("scrollbars/space").element();if(data){if(data.scrollHeight){space.runtimeStyle.height=data.scrollHeight > data.offsetHeight?data.scrollHeight:0;space.runtimeStyle.width=data.scrollWidth > data.offsetWidth?data.scrollWidth:0;var y=scrollbars.clientHeight;var x=scrollbars.clientWidth;data.runtimeStyle.width=x;top.runtimeStyle.width=x;data.runtimeStyle.height=y;left.runtimeStyle.height=y;top.scrollLeft=data.scrollLeft;left.scrollTop=data.scrollTop;scrollbars.runtimeStyle.zIndex=0}else{this.timeout(adjustSize,500)}data.className=data.className+""}data=null;scrollbars=null;top=null;left=null;space=null;this._sizeAdjusted=true};obj.setAction("adjustSize",function(){this.timeout(adjustSize,500)});obj.toString=function(){this.timeout(adjustSize);return _super.toString.call(this)}};Active.Templates.Scroll.create(); Active.Controls.Grid=Active.System.Control.subclass();Active.Controls.Grid.create=function(){var obj=this.prototype;obj.setClass("controls","grid");obj.defineTemplate("layout",new Active.Templates.Scroll);obj.defineTemplate("main",function(){switch(this.getStatusProperty("code")){case "":return this.getDataTemplate();case "error":return this.getErrorTemplate();default:return this.getStatusTemplate()}});obj.defineTemplate("data",new Active.Templates.List);obj.defineTemplate("left",new Active.Templates.List);obj.defineTemplate("top",new Active.Templates.List);obj.defineTemplate("status",new Active.Templates.Status);obj.defineTemplate("error",new Active.Templates.Error);obj.defineTemplate("row",new Active.System.Template);obj.defineTemplate("column",new Active.System.Template);obj.getColumnTemplate=function(i){return this.getTemplate("data/item/item",i)};obj.setColumnTemplate=function(template,i){this.setTemplate("data/item/item",template,i)};obj.getRowTemplate=function(i){return this.getTemplate("data/item",i)};obj.setRowTemplate=function(template,i){this.setTemplate("data/item",template,i)};obj.setTemplate("data/item",new Active.Templates.Row);obj.setTemplate("left/item",new Active.Templates.Item);obj.setTemplate("top/item",new Active.Templates.Header);obj.defineModel("row");obj.defineRowProperty("count",function(){return this.getDataProperty("count")});obj.defineRowProperty("index",function(i){return i});obj.defineRowProperty("order",function(i){return i});obj.defineRowPropertyArray("text",function(i){return this.getRowOrder(i)+1});obj.defineRowPropertyArray("image","none");obj.defineRowPropertyArray("value",function(i){return i});obj.defineModel("column");obj.defineColumnProperty("count",0);obj.defineColumnProperty("index",function(i){return i});obj.defineColumnProperty("order",function(i){return i});obj.defineColumnPropertyArray("text",function(i){return "Column "+i});obj.defineColumnPropertyArray("image","none");obj.defineColumnPropertyArray("value",function(i){return i});obj.defineColumnPropertyArray("tooltip","");obj.defineModel("data");obj.defineDataProperty("count",0);obj.defineDataProperty("index",function(i){return i});obj.defineDataProperty("text","");obj.defineDataProperty("image","none");obj.defineDataProperty("link","");obj.defineDataProperty("value",function(i,j){var text=""+this.getDataText(i,j);var value=Number(text.replace(/[,%\$]/gi,"").replace(/\((.*)\)/,"-$1"));return isNaN(value)?text.toLowerCase()+" ":value});obj.defineModel("items");obj.defineModel("dummy");obj.defineDummyProperty("count",0);obj.defineDummyPropertyArray("value",-1);obj.defineModel("selection");obj.defineSelectionProperty("index",-1);obj.defineSelectionProperty("multiple",false);obj.defineSelectionProperty("count",0);obj.defineSelectionPropertyArray("value",0);obj.defineModel("sort");obj.defineSortProperty("index",-1);obj.defineSortProperty("direction","none");obj.defineModel("status");obj.defineStatusProperty("code",function(){var data=this.getDataModel();if(!data.isReady()){return "loading"}if(!this.getRowProperty("count")){return "nodata"}return ""});obj.defineStatusProperty("text",function(){switch(this.getStatusProperty("code")){case "loading":return "Loading data,please wait...";case "nodata":return "No data found.";default:return ""}});obj.defineStatusProperty("image",function(){switch(this.getStatusProperty("code")){case "loading":return "loading";default:return "none"}});obj.defineModel("error");obj.defineErrorProperty("code",0);obj.defineErrorProperty("text","");obj.getLeftTemplate=function(){var template=this.defaultLeftTemplate();template.setDataModel(this.getRowModel());template.setItemsModel(this.getRowModel());template.setSelectionModel(this.getDummyModel());return template};obj.getTopTemplate=function(){var template=this.defaultTopTemplate();template.setDataModel(this.getColumnModel());template.setItemsModel(this.getColumnModel());template.setSelectionModel(this.getDummyModel());return template};obj.getDataTemplate=function(){var template=this.defaultDataTemplate();template.setDataModel(this.getDataModel());template.setItemsModel(this.getRowModel());return template};obj.setContent(function(){return this.getLayoutTemplate()});obj.setColumnHeaderHeight=function(height){var layout=this.getTemplate("layout");layout.getContent("top").setStyle("height",height);layout.getContent("corner").setStyle("height",height);layout.getContent("left").setStyle("padding-top",height);layout.getContent("data").setStyle("padding-top",height)};obj.setRowHeaderWidth=function(width){var layout=this.getTemplate("layout");layout.getContent("left").setStyle("width",width);layout.getContent("corner").setStyle("width",width);layout.getContent("top").setStyle("padding-left",width);layout.getContent("data").setStyle("padding-left",width)};var startColumnResize=function(header){var el=header.element();var pos=event.clientX;var size=el.offsetWidth;var grid=this;var doResize=function(){var el=header.element();var sz=size+event.clientX - pos;el.style.width=sz < 5?5:sz;el=null};var endResize=function(){var el=header.element();if(typeof el.onmouseleave=="function"){el.onmouseleave()}el.detachEvent("onmousemove",doResize);el.detachEvent("onmouseup",endResize);el.detachEvent("onlosecapture",endResize);el.releaseCapture();var width=size+event.clientX - pos;if(width < 5){width=5}el.style.width=width;var ss=document.styleSheets[document.styleSheets.length-1];var i,selector="#"+grid.getId()+" .active-column-"+header.getItemProperty("index");for(i=0;i<ss.rules.length;i++){if(ss.rules[i].selectorText==selector){ss.rules[i].style.width=width;el=null;grid.getTemplate("layout").action("adjustSize");return}}ss.addRule(selector,"width:"+width+"px");el=null;grid.getTemplate("layout").action("adjustSize")};el.attachEvent("onmousemove",doResize);el.attachEvent("onmouseup",endResize);el.attachEvent("onlosecapture",endResize);el.setCapture();el=null;event.cancelBubble=true};obj.setAction("startColumnResize",startColumnResize);var setSelectionIndex=obj.setSelectionIndex;obj.setSelectionIndex=function(index){setSelectionIndex.call(this,index);this.setSelectionValues([index]);var row=this.getTemplate("row",index);var data=this.getTemplate("layout").getContent("data");var left=this.getTemplate("layout").getContent("left");var scrollbars=this.getTemplate("layout").getContent("scrollbars");try{var top,padding=parseInt(data.element().currentStyle.paddingTop);if(data.element().scrollTop > row.element().offsetTop - padding){top=row.element().offsetTop - padding;left.element().scrollTop=top;data.element().scrollTop=top;scrollbars.element().scrollTop=top}if(data.element().offsetHeight+data.element().scrollTop < row.element().offsetTop+row.element().offsetHeight){top=row.element().offsetTop+row.element().offsetHeight - data.element().offsetHeight;left.element().scrollTop=top;data.element().scrollTop=top;scrollbars.element().scrollTop=top}}catch(error){}};var setSelectionValues=obj.setSelectionValues;obj.setSelectionValues=function(array){var i,current=this.getSelectionValues();setSelectionValues.call(this,array);for(i=0;i<current.length;i++){this.getRowTemplate(current[i]).refreshClasses()}for(i=0;i<array.length;i++){this.getRowTemplate(array[i]).refreshClasses()}this.action("selectionChanged")};var selectRow=function(src){this.setSelectionProperty("index",src.getItemProperty("index"))};var selectMultipleRows=function(src){if(!this.getSelectionProperty("multiple")){return this.action("selectRow",src)}var index=src.getItemProperty("index");var selection=this.getSelectionProperty("values");for(var i=0;i<selection.length;i++){if(selection[i]==index){selection.splice(i,1);i=-1;break}}if(i!=-1){selection.push(index)}this.setSelectionProperty("values",selection);setSelectionIndex.call(this,index);this.getRowTemplate(index).refreshClasses();this.action("selectionChanged")};var selectRangeOfRows=function(src){if(!this.getSelectionProperty("multiple")){return this.action("selectRow",src)}var previous=this.getSelectionProperty("index");var index=src.getItemProperty("index");var row1=Number(this.getRowProperty("order",previous));var row2=Number(this.getRowProperty("order",index));var start=row1 > row2?row2:row1;var count=row1 > row2?row1 - row2:row2 - row1;var i,selection=[];for(i=0;i<=count;i++){selection.push(this.getRowProperty("value",start+i))}this.setSelectionProperty("values",selection);setSelectionIndex.call(this,index);this.getRowTemplate(index).refreshClasses();this.action("selectionChanged")};obj.setAction("selectRow",selectRow);obj.setAction("selectMultipleRows",selectMultipleRows);obj.setAction("selectRangeOfRows",selectRangeOfRows);obj.sort=function(index,direction){var model=this.getModel("row");if(model.sort){return model.sort(index,direction)}var a={};var rows=this.getRowProperty("values");if(direction && direction !="ascending"){direction="descending"}else{direction="ascending"}if(this.getSortProperty("index")!=index){for(var i=0;i<rows.length;i++){a[rows[i]]=this.getDataProperty("value",rows[i],index)}rows.sort(function(x,y){return a[x] > a[y]?1:(a[x]==a[y]?0:-1)});if(direction=="descending"){rows.reverse()}}else if(this.getSortProperty("direction")!=direction){rows.reverse()}this.setRowProperty("values",rows);this.setSortProperty("index",index);this.setSortProperty("direction",direction)};obj.setAction("columnSort",function(src){var i=src.getItemProperty("index");var d=(this.getSortProperty("index")==i)&&(this.getSortProperty("direction")=="ascending")?"descending":"ascending";window.status="Sorting...";this.sort(i,d);this.refresh();this.timeout(function(){window.status=""})});var _getRowOrder=function(i){return this._rowOrders[i]};var _setRowValues=obj.setRowValues;obj.setRowValues=function(values){_setRowValues.call(this,values);var i,max=values.length,orders=[];for(i=0;i<max;i++){orders[values[i]]=i}this._rowOrders=orders;this.getRowOrder=_getRowOrder};obj._kbSelect=function(delta){var index=this.getSelectionProperty("index");var order=this.getRowProperty("order",index);var count=this.getRowProperty("count");var newOrder=Number(order)+delta;if(newOrder<0){newOrder=0}if(newOrder>count-1){newOrder=count-1}if(delta==-100){newOrder=0}if(delta==100){newOrder=count-1}var newIndex=this.getRowProperty("value",newOrder);this.setSelectionProperty("index",newIndex)};obj.setAction("up",function(){this._kbSelect(-1)});obj.setAction("down",function(){this._kbSelect(+1)});obj.setAction("pageUp",function(){this._kbSelect(-10)});obj.setAction("pageDown",function(){this._kbSelect(+10)});obj.setAction("home",function(){this._kbSelect(-100)});obj.setAction("end",function(){this._kbSelect(+100)});var kbActions={38:"up",40:"down",33:"pageUp",34:"pageDown",36:"home",35:"end"};var onkeydown=function(event){var action=kbActions[event.keyCode];if(action){this.action(action);event.returnValue=false;event.cancelBubble=true}};obj.setEvent("onkeydown",onkeydown);function onmousewheel(event){var scrollbars=this.getTemplate("layout").getContent("scrollbars");var delta=scrollbars.element().offsetHeight * event.wheelDelta/480;scrollbars.element().scrollTop -=delta;event.returnValue=false;event.cancelBubble=true}obj.setEvent("onmousewheel",onmousewheel)};Active.Controls.Grid.create(); Active.HTTP.Request=Active.System.Model.subclass();Active.HTTP.Request.create=function(){var obj=this.prototype;obj.defineProperty("URL");obj.defineProperty("async",true);obj.defineProperty("requestMethod","GET");obj.defineProperty("requestData","");obj.defineProperty("responseText",function(){return this._http?this._http.responseText:""});obj.defineProperty("responseXML",function(){return this._http?this._http.responseXML:""});obj.defineProperty("username",null);obj.defineProperty("password",null);obj.setNamespace=function(name,value){this._namespaces+=" xmlns:"+name+"=\""+value+"\""};obj._namespaces="";obj.setParameter=function(name,value){this["_"+name+"Parameter"]=value;if(!this._parameters.match(name)){this._parameters+=" "+name}};obj._parameters="";obj.setRequestHeader=function(name,value){this["_"+name+"Header"]=value;if(!this._headers.match(name)){this._headers+=" "+name}};obj._headers="";obj.setRequestHeader("Content-Type","application/x-www-form-urlencoded");obj.getResponseHeader=function(name){return this._http?this._http.getResponseHeader(name):""};obj.request=function(){var self=this;this._ready=false;var i,name,value,data="",params=this._parameters.split(" ");for(i=1;i<params.length;i++){name=params[i];value=this["_"+name+"Parameter"];if(typeof value=="function"){value=value()}data+=name+"="+encodeURIComponent(value)+"&"}var URL=this._URL;if((this._requestMethod !="POST")&& data){URL+="?"+data;data=null}this._http=window.ActiveXObject?new ActiveXObject("MSXML2.XMLHTTP"):new XMLHttpRequest;this._http.open(this._requestMethod,URL,this._async,this._username,this._password);var headers=this._headers.split(" ");for(i=1;i<headers.length;i++){name=headers[i];value=this["_"+name+"Header"];if(typeof value=="function"){value=value()}this._http.setRequestHeader(name,value)}this._http.send(data);if(this._async){this.timeout(wait,200)}else{returnResult()}function wait(){if(self._http.readyState==4){self._ready=true;returnResult()}else{self.timeout(wait,200)}}function returnResult(){if(self._http.responseXML && self._http.responseXML.hasChildNodes()){self.response(self._http.responseXML)}else{self.response(self._http.responseText)}}};obj.response=function(result){if(this.$owner){this.$owner.refresh()}};obj.isReady=function(){return this._ready}};Active.HTTP.Request.create(); Active.Text.Table=Active.HTTP.Request.subclass();Active.Text.Table.create=function(){var obj=this.prototype;var _super=this.superclass.prototype;obj.response=function(text){var i,s,table=[],a=text.split(/\r*\n/);var pattern=new RegExp("(^|\\t|,)(\"*|'*)(.*?)\\2(?=,|\\t|$)","g");for(i=0;i<a.length;i++){s=a[i].replace(/""/g,"'");s=s.replace(pattern,"$3\t");s=s.replace(/\t$/,"");if(s){table[i]=s.split(/\t/)}}this._data=table;_super.response.call(this)};obj._data=[];obj.getCount=function(){return this._data.length};obj.getIndex=function(i){return i};obj.getText=function(i,j){return this._data[i][j]};obj.getImage=function(){return "none"};obj.getLink=function(){return ""};obj.getValue=function(i,j){var text=this.getText(i,j);var value=Number(text.replace(/[,%\$]/gi,"").replace(/\((.*)\)/,"-$1"));return isNaN(value)?text.toLowerCase()+" ":value}};Active.Text.Table.create(); Active.XML.Table=Active.HTTP.Request.subclass();Active.XML.Table.create=function(){var obj=this.prototype;var _super=this.superclass.prototype;obj.response=function(xml){this.setXML(xml);_super.response.call(this)};obj.defineProperty("XML");obj.setXML=function(xml){if(!xml.nodeType){var s=""+xml;xml=window.ActiveXObject?new ActiveXObject("MSXML2.DOMDocument"):new XMLDocument;xml.loadXML(s)}xml.setProperty("SelectionLanguage","XPath");if(this._namespaces){xml.setProperty("SelectionNamespaces",this._namespaces)}this._xml=xml;this._data=this._xml.selectSingleNode(this._dataPath);this._items=this._data?this._data.selectNodes(this._itemPath):null;this._ready=true};obj.getXML=function(){return this._xml};obj._dataPath="*";obj._itemPath="*";obj._valuePath="*";obj._valuesPath=[];obj._formats=[];obj.setColumns=function(array){this._valuesPath=array};obj.setRows=function(xpath){this._itemPath=xpath};obj.setTable=function(xpath){this._dataPath=xpath};obj.setFormat=function(format,index){this._formats=this._formats.concat();this._formats[index]=format};obj.setFormats=function(formats){this._formats=formats};obj.getCount=function(){if(!this._items){return 0}return this._items.length};obj.getIndex=function(i){return i};obj.getText=function(i,j){var node=this.getNode(i,j);var data=node?node.text:"";var format=this._formats[j];return format?format.dataToText(data):data};obj.getImage=function(){return "none"};obj.getLink=function(){return ""};obj.getValue=function(i,j){var node=this.getNode(i,j);var text=node?node.text:"";var format=this._formats[j];if(format){return format.dataToValue(text)}var value=Number(text.replace(/[,%\$]/gi,"").replace(/\((.*)\)/,"-$1"));return isNaN(value)?text.toLowerCase()+" ":value};obj.getNode=function(i,j){if(!this._items || !this._items[i]){return null}if(this._valuesPath[j]){return this._items[i].selectSingleNode(this._valuesPath[j])}else{return this._items[i].selectNodes(this._valuePath)[j]}};obj.getData=function(i,j){if(!this._items){return null}var node=null;if(this._valuesPath[j]){node=this._items[i].selectSingleNode(this._valuesPath[j])}else{node=this._items[i].selectNodes(this._valuePath)[j]}return node?node.text:null}};Active.XML.Table.create();

Open in new window

/*****************************************************************

	ActiveWidgets Grid 1.0.0 (Free Edition).
	Copyright (C) 2004 ActiveWidgets Ltd. All Rights Reserved. 
	More information at http://www.activewidgets.com/

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*****************************************************************/

xml{display:none;}.gecko{-moz-box-sizing:border-box;}.gecko[onresize]{-moz-binding:url(gecko.xml#resize);}.gecko[onmouseenter], .gecko[onmouseleave]{-moz-binding:url(gecko.xml#mouse);}.active-box-normal{position:relative; overflow-y:hidden; height:18px;width:100%;vertical-align:top;border-width:1px;border-style:none none solid none;border-color:#cbc7b8;background-color:#d6d2c2!important;padding-bottom:1px;}.active-box-item{-moz-box-flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;width:100%;height:100%;padding:0px 5px;border-width:1px;border-style:none none solid none;border-color:#e2decd;background-color:#ebeadb;}.active-box-item.gecko{-moz-binding:url(gecko.xml#item);}.active-gecko-item{display:-moz-inline-box;height:100%;-moz-box-align:center;}.active-box-image{overflow:hidden; top:0px;left:0px;width:16px;height:100%;line-height:1px;vertical-align:middle;margin:0px 3px -1px 0px;}.active-box-image.gecko{display:-moz-inline-box;vertical-align:top;}.active-image-none{width:0px;margin-right:0px;}.active-box-resize{position:absolute;overflow:hidden;top:15%;right:-5px;width:10px;height:70%;font-size:100px;background:url(grid.png) -75px 0px no-repeat;cursor:e-resize;}.active-box-sort{display:-moz-inline-box;overflow:hidden;width:0px;height:100%;vertical-align:top;}.active-box-item .active-box-image.gecko,.active-box-item .active-box-sort.gecko{height:16px;}.active-sort-ascending .active-box-sort{width:16px;background:url(grid.png) -20px 50% no-repeat;}.active-sort-descending .active-box-sort{width:16px;background:url(grid.png) -40px 50% no-repeat;}.active-box-resize.gecko{position:relative;top:15%;margin-left:-5px;margin-right:-5px;line-height:12px;z-index:1000;}.active-scroll-data{position:absolute;overflow:hidden;top:0px;left:0px;width:100%;height:100%;padding:18px 0px 0px 28px;z-index:1;}.active-scroll-top{position:absolute;overflow:hidden;white-space:nowrap;top:0px;left:0px;width:100%;height:18px;padding:0px 20px 0px 28px;z-index:2;}.active-scroll-left{position:absolute;overflow:hidden;top:0px;left:0px;width:28px;height:100%;padding:18px 0px 20px 0px;text-align:center;z-index:2;}.active-scroll-corner{position:absolute;overflow:hidden;top:0px;left:0px;width:28px;height:18px;z-index:3;}.active-scroll-bars{position:absolute;overflow:auto;top:0px;left:0px;width:100%;height:100%;padding:0px;z-index:4;}.active-scroll-space{width:0px; height:0px;}.active-scroll-fill{display:inline;height:100%;}.active-scroll-fill.gecko{display:-moz-inline-box;}.active-scroll-data.gecko,.active-scroll-top.gecko,.active-scroll-left.gecko{overflow:-moz-scrollbars-none;}.active-controls-grid{position:relative; overflow:hidden;width:100%;height:100%;cursor:default;-moz-user-focus:normal;-moz-user-select:none; }.active-templates-header{display:inline;width:100px;height:100%;}.active-header-over{border-color:#f9b119;background:#fcc247!important;}.active-header-over .active-box-item{border-color:#f9a900;background:#faf9f4;}.active-header-over .active-box-resize{background:none;}.active-header-pressed{border-color:threeddarkshadow threedhighlight threedhighlight threeddarkshadow;}.active-header-pressed .active-box-item{position:relative;left:1px;top:1px;border-color:threedface;}.active-templates-header.gecko{display:-moz-inline-box;}.active-templates-row{overflow-y:hidden;white-space:nowrap;width:100%;height:18px;-moz-user-select:none;}.active-row-cell{display:inline;overflow:hidden;text-overflow:ellipsis;width:100px;height:100%;padding:0px 5px;line-height:17px;}.active-row-cell.gecko{display:-moz-inline-box;}.active-selection-true, .active-selection-true .active-row-cell{color:highlighttext!important;background-color:highlight!important;}.active-column-0{z-index:99}.active-column-1{z-index:98}.active-column-2{z-index:97}.active-column-3{z-index:96}.active-column-4{z-index:95}.active-column-5{z-index:94}.active-column-6{z-index:93}.active-column-7{z-index:92}.active-column-8{z-index:91}.active-column-9{z-index:90}.active-column-10{z-index:89}.active-column-11{z-index:88}.active-column-12{z-index:87}.active-column-13{z-index:86}.active-column-14{z-index:85}.active-column-15{z-index:84}.active-column-16{z-index:83}.active-column-17{z-index:82}.active-column-18{z-index:81}.active-column-19{z-index:80}.active-templates-text, .active-templates-image{-moz-binding:url(gecko.xml#box);}.active-gecko-box{-moz-box-flex:1;overflow:hidden; height:100%;width:100%;}.active-templates-status, .active-templates-error{padding:5px;}.active-scroll-left .active-box-normal{border-top:1px solid #faf9f4;border-right:1px solid #d6d2c2;border-bottom:none;}.active-image-txt{background:url(icons.png)  -20px 50% }.active-image-htm{background:url(icons.png)  -40px 50% }.active-image-xls{background:url(icons.png)  -60px 50% }.active-image-doc{background:url(icons.png)  -80px 50% }.active-image-pdf{background:url(icons.png) -100px 50% }.active-image-xml{background:url(icons.png) -120px 50% }.active-image-msi{background:url(icons.png) -140px 50% }.active-image-chm{background:url(icons.png) -160px 50% }.active-box-image{background-repeat:no-repeat}.active-image-loading{position:relative;top:20px;left:0px;width:107px;height:13px;margin-right:-107px;background:url(loading.gif) no-repeat;}

Open in new window

thanks..i am going to take a different approach and load the exmaple into my server first..once i have that working I will load the code you helped me with..: will be a day to two..let you know..