<html>
<head>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/xp/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>
<style>
body, html {
margin:0px; padding: 0px; overflow: hidden; font: menu;
}
.active-controls-grid {height:330; text-align:bottom; border:1px solid #cccccc}
.active-column-0 {width: 115px;}
.active-column-1 {width: 300px; background-color: #F4F7D2}
.active-column-2 {width: 350px;}
.active-column-3 {width: 100px; text-align:right; background-color: #F4F7D2}
.active-grid-column {border-right: 1px solid threedlightshadow;}
.active-grid-row {border-bottom: 1px solid threedlightshadow;}
</style>
</head>
<body>
<script>
var string = new Active.Formats.String;
var money = new Active.Formats.Number;
var qty = new Active.Formats.Number;
// define formatting rule for text output
money.setTextFormat("#,###.##");
qty.setTextFormat("");
// set var columns XPath
var columnNodes = ["CODE", "NAMETH", "ADDRESSTH", "DEBTAMOUNT"];
var dataXML = new Active.HTTP.Request;
// URL
dataXML.setURL("http://localhost/yourweb/yourService.asmx/GetYourMethod");
// set request method to POST (default is GET)
dataXML.setRequestMethod("POST");
// set expected response type (default is text/xml)
// set request parameters (i.e. form values)
dataXML.setParameter("companyCode", "T01");
dataXML.setParameter("user", "");
dataXML.setParameter("code", "B-00");
dataXML.setParameter("searchInMaster", false);
dataXML.setParameter("manualCriteria", "");
// set event handler to process the result
var table = new Active.XML.Table;
dataXML.response = function(text){
table.setRows("//NewDataSet/*");
// set columns XPath
table.setColumns(columnNodes);
// set column formatting
table.setFormats([string, string, string, money]);
table.response(text);
};
// send the request (async)
dataXML.request();
var obj = new Active.Controls.Grid;
obj.setDataModel(table);
obj.setColumnProperty("texts", columnNodes);
document.write(obj);
</script>
</body>
</html>
This topic is archived.