当前位置:早雪网网络学院编程文档Script → 类似ListView ,htc组件

类似ListView ,htc组件

减小字体 增大字体 作者:未知  来源:从互联网收集整理并转载  发布时间:2005-3-8 0:44:31

listview2_0_2.htc:
<public:component tagName="listview" lightweight=true>
<public:attach event="oncontentready" onevent="oncontentready()" />

<public:property name="width" />
<public:property name="height" />
<public:property name="dataXML" />
<public:property name="XmlDoc" />
<public:property name="text" >
<public:property name="currentRow" />
<public:property name="selectedRowBackgroundColour" value="steelblue" />
<public:property name="selectedRowColour" value="white" />
<public:property name="lvdata" />
<public:property name="lvhead" />
<public:property name="toolbarDisplay" value="" />
<public:property name="toolbar" />
<public:property name="table" />
<public:property name="listTable" />
<public:property name="displayToolbar" value="true" />
<public:property name="toolbarDisplay" value=""/>
<public:property name="wrapHeadings" value="true" />
<public:property name="saveOptions" value="[['html','HTML'],['word','Word'],['excel','Excel'],['xml','XML']]"/>
<public:property name="smallButtons" value="true">
<public:property name="pageSize" value="25"/>
<public:property name="pageNumber" value="1"/>
<public:property name="pageCount" value="0"/>
<public:property name="rowCount" value="0"/>
<public:property name="maxRowCount" value="100" />
<public:property name="search" value="false" id="searchId"/>
<public:property name="updateRow" value="false" id="updateRowId"/>
<public:property name="insertRow" value="false" id="insertRowId"/>
<public:property name="deleteRow" value="false" id="deleteRowId"/>
<public:property name="save" value="false" id="saveId"/>
<public:property name="print" value="false" id="printId"/>
<public:property name="copy" value="false" id="copyId"/>
<public:property name="help" value="false" id="helpId"/>
<public:property name="columnPicker" value="false" id="columnPickerId"/>
<public:property name="sort" value="false" id="sortId"/>
<public:property name="rowInfo" value="true" id="rowInfoId"/>
<public:property name="pageInfo" value="true" id="pageInfoId"/>
<public:property name="editRow" value="true" id="editRowId"/>
<public:property name="buttonNavigation" value="true" id="buttonNavigationId"/>
<public:property name="orderColumn" value=""/>
<public:property name="lvformat" />
<public:property name="lvstyle" />

<public:method name="loadText" />
<public:method name="loadData" />
<public:method name="drawData" />
<public:method name="selectRow" />
<public:method name="selectPage"/>
<public:method name="setRowStyle" />
<public:method name="configureToolBar"/>
<public:method name="saveGrid">
<public:method name="setColumnProperty" />
<public:method name="reload" />
<public:method name="formatColumnValue" />

<public:event name="onRowSelected" id="_lvevtRowSelected"/>
<public:event name="onListviewReady" id="_lvevtListviewReady"/>
</public:component>

<SCRIPT LANGUAGE="JavaScript">
//------------------------------------------------------------
// Copyright (c) 2003-2004 LeadinSoft. All rights reserved.
// Version 2.0.1
// Ahthor dolphin
// Modify Date 2004-1-5
//------------------------------------------------------------
var L_Loading_Text = "正在载入数据,请稍候...";
var L_AbortControl_ErrorMessage = "控件初始化出错,不能够载入";
var navButtons = ["first","prev","next","last"];
var buttons = ['first','prev','next','last','search','updateBtn','insertBtn','deleteBtn','save','copy','help','columnPicker','sort','print'];

//-------------------------------------------------------------

/**
 * 初始化ListView
 *
 * XMLDOM实例
*/
function oncontentready(){
 element.innerHTML = "<span style='color:#8F8F8F'><b>"+ L_Loading_Text +"</b></span>";
 XmlDoc = new ActiveXObject("Microsoft.XMLDOM");
 initialise();
}
/**
 * 初始化ListView框架
 *
 * 建立listview表头
 * 初始化数据数组
 * 建立listview的工具栏和全局变量
*/
function initialise(){
 lvdata = new Array();   //存放数据的数组
 lvhead = new Array();   //存放表头的数组
 lvformat = new Object();  //存放格式化数据对象
    lvstyle  = new Array();   //存放过滤条件的数组对象
 text = new Object();   //存放工具栏信息对象
 saveOptions = eval(saveOptions);
 maxRowCount = parseInt(maxRowCount);
 
 //载入工具栏信息
 loadText();
 
 //属性改变触发
 element.onpropertychange = propertyChange;

 var html = "";

 //判断工具栏是否显示
 if(toolbarDisplay == '')
  toolbarDisplay = eval(displayToolbar) ? '' : 'none';
 
 //-------------------------- 建立工具栏 ----------------------------------
 html = "<table id=toolbar class=lvtoolbar cellpadding=0 cellspacing=0 style='display:" + toolbarDisplay + "'><tr>";
 html += "<td id=searchCell>" + makeButton('search') + " </td>";
 html += "<td id=editRowCell><table cellpadding=0 cellspacing=0><tr>"
 html += "<td id=updateRowCell>" + makeButton('updateBtn') + "</td>";
 html += "<td id=insertRowCell>" + makeButton('insertBtn') + "</td>";
 html += "<td id=deleteRowCell>" + makeButton('deleteBtn') + " </td>";
 html += "</tr></table></td>"
 
 //建立Navigation栏
 for(var i in navButtons){
  html += "<td id=" + navButtons[i] + "Cell>" + makeButton( navButtons[i] ) + "</td>"
  if (i==1)
   html += "<td id=pageInfoCell> " + text['page'] + " <select class=lv id=pageNumber></select> " + text['of'] + " <input class=lv id=pageCount readonly type=text size=1></input> </td>";
 }

 html += "<td id=rowInfoCell> " + text['rows'] + " <input class=lv id=rowCount readonly type=text

[1] [2] [3] [4] [5] [6]  下一页

[数据载入中...] [返回上一页] [打 印]