1.“客户”显示的是客户代码,可动态引用外部Treelist(相当于引用主键的View、也即字典表), 同时观察“客户”列的变化 →
2.表格目前仅用于查看,可改为可编辑 → , 修改“客户”的下拉按钮样式 → , 不显示垂直表格线 →
3.按城市、日期排序 → , 可显示多重排序区 → , 将订单号、国家冻结在左侧 →
4.货重>100的行以深色显示 → , 修改若干单元格的字体、颜色 →




1.可查看创建该TreeList的XML描述文件
2.可查看被引用的“客户”的TreeList的XML描述文件
3.源码分析:按钮分别执行如下js:
function ref_customer() //改成引用外部Treelist
{
 AF.func("AddDroplist", "id=customer; treelist=customer.xml; DataCol=customerid; DisplayCol=companyname");
 AF.func("SetColProp", "CustomerID \r\n edittype   \r\n droptreelist");
 AF.func("SetColProp", "CustomerID \r\n droplistID \r\n customer");
}
function seteditable()  //切换到可编辑状态
{
 AF.func("SetProp", "editable \r\n true");
}
function buttonimg()  //修改下拉按钮图标
{
 AF.func("SetColProp", "CustomerID \r\n buttonImg \r\n buttons.zip#302.ico");
}
function setsort() //排序
{
 AF.func("SetProp", "sort \r\n OrderDate,ShipCity");
}
function showPanel() //显示排序区
{
 AF.func("SetProp", "isShowSortPanel \r\n true");
}
function seperate()  //冻结
{
 AF.func("SetProp", "seperateBar \r\n 1");  //第一列冻结
}
function dybackcolor()  //动态更改行的背景色
{
 //transparent表示透明,即无背景色
 AF.func("SetProp", "displaymask \r\n backColor=if(freight>100, #334455, transparent)");
}
function cellsProp()  //更改个别单元格的属性
{
 AF.func("SelectRow", "0");
 AF.func("SetcellFontIndex", "2 \r\n Country \r\n 3");
 AF.func("SetcellBackColor", "2 \r\n Country \r\n red");

 AF.func("SetcellFontIndex", "3 \r\n Freight \r\n 3");
 AF.func("SetcellBackColor", "3 \r\n Freight \r\n blue");

 AF.func("SetcellFontIndex", "4 \r\n CustomerID \r\n 3");
 AF.func("SetcellBackColor", "4 \r\n CustomerID \r\n blue");
}
使用够简单吧!