3.2.0

Error with two grids on the same page

Hi everybody, i'm using de AW GRID with PHP, i've created a function used to creates the grid and generate dinamic id's for it, so i can use more than just one grid per page, the problem is that when i have more than 1 grid on the page, all the grids on the page get locked, so i can resize a column, or even click on a cell.

This ocurres only when i have more than 1 grid per page, i'll post the javascript code that i'm using to generate the two grids, so if somebody can help me.

Bellow is the code that my php function was returned...thx...

<script>
var obj_headers_1 = ["Tipo","Quantidade de eventos"];
var obj_data_1= [ ["","1"],["CORE CTO","1"]	];
var grid_1 = new AW.UI.Grid; 
grid_1.setId('awgrid_1'); 
grid_1.setHeaderText(obj_headers_1); 
grid_1.setSize(100, 150); 
grid_1.setCellText(obj_data_1); 
grid_1.setColumnCount(obj_headers_1.length); 
grid_1.setRowCount(obj_data_1.length); 
grid_1.setColumnWidth(100,0);
grid_1.setColumnWidth(100,1);
document.write(grid_1); 
</script>

<script>
var obj_headers_2 = ["ID Acesso","Nome","LP","Tipo","Data"];
var obj_data_2 = [
    ["","inventario teste 1","","Primário","31/07/2006 00:00:00"],
    ["","inventario teste 2","","Primário","31/07/2006 00:00:00"],
    ["","inventario teste 2","","Redundante","01/05/2006 12:00:20"]
];
var grid_2 = new AW.UI.Grid; 
grid_2.setId('awgrid_2'); 
grid_2.setHeaderText(obj_headers_2); 
grid_2.setSize(100, 150); 
grid_2.setCellText(obj_data_2); 
grid_2.setColumnCount(obj_headers_2.length); 
grid_2.setRowCount(obj_data_2.length); 
grid_2.setColumnWidth(55,0);
grid_2.setColumnWidth(120,1);
grid_2.setColumnWidth(115,2);
grid_2.setColumnWidth(10,3);
grid_2.setColumnWidth(70,3);
document.write(grid_2); 
</script>

Gabriel Ricci da Silva
October 16,
I discovered that the error that firefox throws is:

obj has no properties

and this error is in this block of code:

(function(){AW.all={id:0};AW.docs=[document];AW.log=function(level,arg){try{var i,s="";for(i=0;i<arg.length;i++){s+=arg[i]+" "}window.status=s}catch(error){window.status=error.message}};AW.debug=function(){AW.log("debug",arguments)};AW.info=function(){AW.log("info",arguments)};AW.warn=function(){AW.log("warn",arguments)};AW.error=function(){AW.log("error",arguments)};AW.fatal=function(){AW.log("fatal",arguments)};AW.forEach=function(array,handler){var i,custom={};for(i in array){if(!custom[i]){handler(i,array[i])}}};AW.element=function(id){var i,e,docs=AW.docs;for(i=0;i<docs.length;i++){e=docs[i].getElementById(id);if(e){return e}}};AW.object=function(id){var parts=id.split("-");var tag=parts[0];var obj=AW.all[tag];var target=obj;for(var i=1;i<parts.length;i++){if(obj["_"+parts[i]+"Content"]){for(var j=i;j<parts.length;j++){target=target.getContent(parts[j])}break}else if(parts[i+1] && parts[i+1].match(/^(\d+)$/)){if(parts[i+2] && parts[i+2].match(/^(\d+)$/)){if(parts[i+3] && parts[i+3].match(/^(\d+)$/)){obj=obj.getTemplate(parts[i],parts[i+1],parts[i+2],parts[i+3]);i+=3}else{obj=obj.getTemplate(parts[i],parts[i+1],parts[i+2]);i+=2}}else{obj=obj.getTemplate(parts[i],parts[i+1]);i+=1}}else{obj=obj.getTemplate(parts[i])}target=obj}return target};var events={"DOMFocusIn":"focus"};AW.dispatch=function(element,event){var type="_on"+(events[event.type] || event.type)+"Event";var target=AW.object(element.id);var obj=target;while(obj._parent){obj=obj._parent}return target[type].call(obj,event)};AW.paint=function(element){var obj=AW.object(element.id);while(obj._parent){obj=obj._parent}if(obj && obj.raiseEvent && !obj.$paint){obj.$paint=true;obj.raiseEvent("paint")}window.setTimeout(function(){element.style.removeExpression("visibility");element.style.display="none";if(obj && obj.$paint){obj.$paint=false}},0);return "hidden"};AW.camelCase=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};AW.textPattern=/(\"|&|<|>)/gm;AW.textTable={"\"":"&quot;","&":"&amp;","<":"&lt;",">":"&gt;"};AW.textReplace=function(c){return AW.textTable[c] || ""};AW.htmlPattern=/(&quot;|&amp;|&lt;|&gt;|<[^<>]*>)/gm;AW.htmlTable={"&quot;":"\"","&amp;":"&","&lt;":"<","&gt;":">"};AW.htmlReplace=function(e){return AW.htmlTable[e] || ""};AW.valueToText=function(v){return v?String(v).replace(AW.textPattern,AW.textReplace):""};AW.textToValue=function(t){return t?String(t).replace(AW.htmlPattern,AW.htmlReplace):""}})();
Gabriel Ricci da Silva
October 16,
PROBLEM FIXED - I think that the problem was on my PHP Function....the function includes the aw.css and aw.js, via echo, i just put the includes on the HTML and everything works fine...

By the way, thanks everybody!
Gabriel Ricci da Silva
October 16,

This topic is archived.

See also:


Back to support forum