1.本页演示通过表达式实现过滤功能;
2.注意最后一个过滤表达式演示了 js( ) 函数,能反向调用(Callback)页面的JavaScript
请选择或输入表达式:  



1.单纯的过滤功能用处不大,但是过滤下拉Treelist是很有可能会发生的,下一个demo页中将会遇到;
2.可查看创建该TreeList的XML描述文件
3.源码分析:关注下面第10到22行之间的下拉框的另类创建法:
<script language="JavaScript">
 function OnReady(id)
 {
  if(id=='AF') {
   AF.func("Build", "treelist/t1.xml");
   AF.func("Load", "treelistdata/data.txt");
  }
  else if(id=='AE') {	//Edit控件
   //直接写在页面中的XML文档串
   var xml = '<?xml version="1.0"?>\
   <TreeList>\
   <Properties isShowGrid="false" isAutoFitWidth="true" headerHeight="0"/>\
   <Cols><Col name="filterstr" width="100">filterstr</Col></Cols>\
   <Table>\
   <TR><filterstr></filterstr></TR>\
   <TR><filterstr>Freight>400</filterstr></TR>\
   <TR><filterstr>indexOf(ShipName, "ome")>=0</filterstr></TR>\
   <TR><filterstr>indexOf(ShipName, "ome")>=0 and left(RequiredDate, 4)="2007"</filterstr></TR>\
   <TR><filterstr>indexOf(ShipName, "ome")>=0 and not left(RequiredDate, 4)="2007"</filterstr></TR>\
   <TR><filterstr>country=js("jsFunc")</filterstr></TR>\
   </Table>\
   </TreeList>';
   AE.func("BuildTreeList", xml);
  }
 }

 //按钮执行的js
 function filter()
 {
  var filterStr = AE.func("GetText", "");
  AF.func("Filter", filterStr);
 }

 //供过滤表达式反向调用的函数
 function jsFunc()
 {
   return "Finland";
 }
</script>