ActiveWidgets Grid 1.0

Forum >> Version 1 >>

"... I just put your grid into a reporting application and my clients went nuts!"

Are you building a great new web application? Want to impress your boss or win an important contract? Try the javascript grid control - it has nearly all the features and the same look as the native win32 component! Check the live demo below:

http://www.activewidgets.com/javascript.forum.3534.0/xml-and-drop-down-menu.html

Browse for more examples.

 

XML and drop down menu - please help

i work at a grid with data from XML ; i've read /javascript.forum.1621.5/editable-templates-with-xml-data.html
and i have implemented setText() method but :<<
var select = new My.Templates.Select;
select.setOptionsProperty("texts", ["1", "2", "3", "4", "Nessuno"]);
select.setOptionsProperty("values", ["1", "2", "3", "4", " "]);
select.setOptionsProperty("count", 5);
obj.setColumnTemplate(select, 2);>>
doesn't work
any idea?
thx

my complete script:
<script>
var table = new Active.XML.Table;

table.setURL("uploads/atest.xml");
table.request();
var columns = ["SCUOLA","CDCSCUOLA","ORDINE","DENOMINAZIONE","INDIRIZZO","SERVIZIO","FORM","TEL_R","TEL_D","CAP_R"];
var obj = new Active.Controls.Grid;
obj.setId("maingrid");
obj.setColumnProperty("texts", columns);

/* Need to add this so objects edited in grid customization don't get change if user cancels */
function clone (deep) {
var objectClone = new this.constructor();
for (var property in this)
if (!deep)
objectClone[property] = this[property];
else if (typeof this[property] == 'object')
objectClone[property] = this[property].clone(deep);
else
objectClone[property] = this[property];
return objectClone;
}
Object.prototype.clone = clone;

obj.setEvent("onkeydown", null);
obj.styleSheet = document.styleSheets[document.styleSheets.length-1];
obj.getTemplate("top").setEvent("onselectstart", obj.getEvent("onselectstart"));
obj.setEvent("onselectstart", null);
obj.getTemplate("row").setEvent("onmouseover", "mouseover(this, 'active-row-highlight')");
obj.getTemplate("row").setEvent("onmouseout", "mouseout(this, 'active-row-highlight')");

obj.alternateColors = ["#fff8f8", "#f8fff8", "#f8f8ff"];
obj.alternate = function(){ return obj.alternateColors[this.getProperty("row/order") % obj.alternateColors.length]; }
obj.getTemplate("row").setStyle("background", obj.alternate);

var select = new My.Templates.Select;
select.setOptionsProperty("texts", ["1", "2", "3", "4", "Nessuno"]);
select.setOptionsProperty("values", ["1", "2", "3", "4", " "]);
select.setOptionsProperty("count", 5);
obj.setColumnTemplate(select, 2);
//var selectTemplate = new My.Templates.StatusSelect;
//selectTemplate.addOption('Test 1','0001')
//selectTemplate.addOption('Test 2','0002')
//selectTemplate.addOption('Test 3','0003')
//obj.setColumnTemplate(selectTemplate,2);
obj.setColumnTemplate(new My.Templates.Input, 1);
obj.setColumnTemplate(new My.Templates.Input, 3);




function myColor(){ var value = this.getItemProperty('value'); return value == '' ? 'yellow' : 'white';}

obj.getColumnTemplate(1).setStyle('background-color', myColor);
obj.getColumnTemplate(3).setStyle('background-color', myColor);
obj.getColumnTemplate(7).setStyle('background-color', myColor);


table.setText = function(value, i, j){
var node = this.getNode(i, j);
node.text = value;
}
obj.setDataModel(table);
document.write(obj);


</script>
roberto
Friday, February 25, 2005

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值