import win.ui;
import godking.vlistEx;
/*DSG{{*/
mainForm = win.form(text="vlistEx - table adapter";right=849;bottom=578)
mainForm.add(
button={cls="button";text="查找";left=231;top=518;right=343;bottom=568;z=2};
button2={cls="button";text="过滤显示";left=385;top=518;right=497;bottom=568;z=3};
button3={cls="button";text="取消过滤";left=518;top=519;right=630;bottom=569;z=4};
vlist={cls="vlistEx";left=8;top=8;right=838;bottom=513;db=1;dl=1;dr=1;dt=1;edge=1;transparent=1;z=1}
)
/*}}*/
var fields,cols = {},{};
for(i=1;10;1){
table.push(fields,"f"++i);
table.push(cols, "第"++i++"列");
}
var t = {fields=fields};
for(i=1;1000;1){
var s={}
for(n=1;10;1){
s["f"++n] = i+n-1;
}
table.push(t,s);
}
mainForm.button.oncommand = function(id,event){
t = mainForm.vlist.find("50",/*开始行*/,/*结束行*/,/*查询列*/,true/*全部*/,true/*模糊*/,false/*去重行*/);
import console
console.dump(t);
console.dump("包含重复行,共:" ++ #t);
t = mainForm.vlist.find("50",/*开始行*/,/*结束行*/,/*查询列*/,true/*全部*/,true/*模糊*/,true/*去重行*/);
import console
console.dump("去除重复行,共:" ++ #t);
t = mainForm.vlist.find("50",/*开始行*/,/*结束行*/,/*查询列*/,false/*全部*/,false/*模糊*/,false/*去重行*/);
import console
console.dump("仅找第一个:" , t);
}
mainForm.button2.oncommand = function(id,event){
mainForm.vlist.filter("50",/*查询列*/,false/*模糊*/);
}
mainForm.button3.oncommand = function(id,event){
mainForm.vlist.filter();
}
mainForm.vlist.setTable(t,cols,100,1);
mainForm.show();
win.loopMessage();