3.2.0

Template do not seem to work on my codes

i got this codes.... why does my cell dont change into textbox ...
whats missing...??? hope anyone could help me with this thing...



<html>
<head>
<title>::GRID HEADER::</title>

<style>
body, html {margin:0px; padding: 0px; overflow: hidden;border:none}
.line, .line2 {
color: #009;
font-family: Tahoma, MS Sans Serif, helvetica;
font-weight: bold;
font-size: 11px;
margin-bottom: 5px;
}

.line2 {
font-weight: normal;
}

.loading {
width:400px;
height:20px;
background:url(../runtime/styles/xp/loading.gif) no-repeat;
}
</style>

<!-- grid data -->


<script>


var gridHeader_data = [
["hello","&nbsp;","&nbsp;","&nbsp;",
"&nbsp;","&nbsp;","&nbsp;","&nbsp;",
"&nbsp;","&nbsp;","&nbsp;","&nbsp;",
"&nbsp;","&nbsp;","&nbsp;","&nbsp;",
"&nbsp;","&nbsp;","&nbsp;","&nbsp;",
"&nbsp;","&nbsp;","&nbsp;","&nbsp;"],
["&nbsp;","&nbsp;","&nbsp;","&nbsp;",
"&nbsp;","&nbsp;","&nbsp;","&nbsp;",
"&nbsp;","&nbsp;","&nbsp;","&nbsp;",
"&nbsp;","&nbsp;","&nbsp;","&nbsp;",
"&nbsp;","&nbsp;","&nbsp;","&nbsp;",
"&nbsp;","&nbsp;","&nbsp;","&nbsp;"],
["&nbsp;","&nbsp;","&nbsp;","&nbsp;",
"&nbsp;","&nbsp;","&nbsp;","&nbsp;",
"&nbsp;","&nbsp;","&nbsp;","&nbsp;",
"&nbsp;","&nbsp;","&nbsp;","&nbsp;",
"&nbsp;","&nbsp;","&nbsp;","&nbsp;",
"&nbsp;","&nbsp;","&nbsp;","&nbsp;"]

];

var gridHeader_columns = [
"ID","poid","referenceid","referencecode","po_ref_id","po_ref_code","item_id","item_code","inventory_id",
"description","qty_purchased","qty_to_order","unit_type","unit_id","unit","notes","notes_value","estimated_cost",
"money_conversion_id","currency","referenc_line_id","original_unit_id","original_qty"
];
//myColumns = parent.gridHeader_columns;

</script>
</head>
<body>

<div id="box" style="height:100%;width:100%;">
<div style="padding:0px 50px">
<div class="line">&nbsp;</div>
<div class="line2">Loading grid ...</div>
<div class="loading"></div>
</div>
</div>

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

<!-- grid format -->
<style>
.active-controls-grid {height: 100%; font: menu;}
.active-column-0 {width: 0px;}
.active-column-1 {width: 0px;}
.active-column-2 {width: 0px;}
.active-column-4 {width: 0px;}
.active-column-8 {width: 0px;}
.active-column-18 {width: 0px;}
.active-column-20 {width: 0px;}
.active-column-21 {width: 0px;}
.active-column-13 {width: 0px;}
.active-column-6 {width: 0px;}
.active-column-22 {width: 0px;}

.active-column-0 .active-box-resize {display: none; width: 1px;}
.active-column-1 .active-box-resize {display: none; width: 1px;}
.active-column-2 {text-align: right; color: #009}

.active-column-4 {text-align: right;}

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

.active-templates-row.gecko {
display: -moz-box;
width: auto;
min-width: 100%;
}

.active-row-highlight {background-color: #ddeeff!important}
.active-row-highlight .active-row-cell {background-color: #ddeeff;}

.active-mark-true .active-column-2 {color: #f00}
.active-templates-item {color: threedface;}


</style>

<script>


try {

// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;
var ddgridTemplate = new My.Templates.GridSelect;
myGridData=[
['PACK'],
['LOOSE']
];
ddgridTemplate.setGridProperty("rows", myGridData);
ddgridTemplate.setGridProperty("columns", ["Unit Type"]);
obj.setColumnTemplate(ddgridTemplate,12);
// set number of rows/columns
obj.setRowProperty("count", gridHeader_data.length);
obj.setColumnProperty("count", gridHeader_columns.length);

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

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

obj.setSelectionMultiple(true);

var alternate = function(){
return this.getProperty("row/order") % 2 ? "#fcfaf6" : "#ffffff";
}

var mark = function(){
var i = this.getProperty("row/index");
return (i==2 || i==4 || i==5) ? false : false;
}

var row = new Active.Templates.Row;
row.setStyle("background", alternate);
row.setClass("mark", mark);
row.setEvent("onmouseover", "mouseover(this, 'active-row-highlight')");
row.setEvent("onmouseout", "mouseout(this, 'active-row-highlight')");
obj.setTemplate("row", row);

// set click action handler
//obj.setAction("click", function(src){
//var rowarray=new Array();
//rowarray=src.getItemProperty("text",1);
// var i=src.getSelectionProperty("index");
// var rowarray = src.getDataProperty("text",i,0);

//alert(rowarray);
//window.status = src.getItemProperty("text",3)
//});
var message = function(src){
var i=src.getSelectionProperty("index");
var rowarray = src.getDataProperty("text",i,0);



alert(rowarray);
///parent.setbottomgrid(rowarray);
//parent.bottomcontent.src='grids/gridlines.php?com=$cnStr&po_id=rowarray';

}
//obj.setAction("selectionChanged", message);


// write grid html to the page

window.setTimeout(function(){
try {
document.getElementById("box").innerHTML = obj;
}
catch(e){
}
}, 100);

// document.write(obj);

}
catch(e){
}

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

thanks
glennlosentes [noypi]
August 16,
if everyone was not trying to snick around &hide shit u could write with out all this b.s. and read it toooooooo
September 30,

This topic is archived.

See also:


Back to support forum