[SOLVED]
Hi
I have this code and i want to put into a joomla module but , when i inserted - get a blank page with no result on it
<link rel="STYLESHEET" type="text/css" href="codebase/dhtmlxgrid.css">
<script src="codebase/dhtmlxcommon.js"></script>
<script src="codebase/dhtmlxgrid.js"></script>
<script src="codebase/dhtmlxgridcell.js"></script>
<script src="codebase/dhtmlxcombo.js"></script>
<script src="codebase/ext/dhtmlxgrid_filter.js"></script>
<script src="codebase/excells/dhtmlxgrid_excell_link.js"></script>
<script>
var mygrid;
function doInitGrid(){
mygrid = new dhtmlXGridObject('mygrid_container');
mygrid.setImagePath("codebase/imgs/");
mygrid.setHeader("Shape,Size,Color,Clarity,Certificat,Finisaj,Fluor,Certif-Link");
mygrid.setInitWidths("*,100,*,*,100,*,*,100");
mygrid.setColAlign("left,center,center,center,center,center,center,center")
mygrid.setSkin("light");
mygrid.setColSorting("str,int,str,str,str,str,str,str");
mygrid.setColTypes("ed,ed,ed,ed,ed,ed,ed,link");
mygrid.attachHeader('#select_filter,#numeric_filter,#select_filter,#select_filter,#select_filter,#select_filter,#select_filter,#rspan');
mygrid.attachEvent("onRowSelect",doOnRowSelected);
mygrid.init();
mygrid.loadXML("step3.xml");
}
function addRow(){
var newId = (new Date()).valueOf()
mygrid.addRow(newId,"",mygrid.getRowsNum())
mygrid.selectRow(mygrid.getRowIndex(newId),false,false,true);
}
function removeRow(){
var selId = mygrid.getSelectedId()
mygrid.deleteRow(selId);
}
function doOnRowSelected(rowID,celInd){
alert("Selected row ID is "+rowID+"\nUser clicked cell with index "+celInd);
}
</script>
<body.onload="doInitGrid()">
<div id="mygrid_container" style="width:600px;height:150px;"></div>
<button onclick="addRow()">Add Row</button>
<button onclick="removeRow()">Remove Row</button>
This image is hidden for guests.
Please log in or register to see it.
I think is a body onload problem but i can not get this out to work. The Joomla module what i use is mod_flexi_customcode.
can you help me please to resolve the body onload problem.
Thanks,
Alex
body onload replacement
<script type="text/javascript">
if(window.addEventListener){
window.addEventListener('load', your function name, false);
}
else {
if(window.attachEvent){
window.attachEvent('onload',your function name);
}
}
function your function name here() { your function code here};
</script>
Alex