import win.ui;
import godking.vlistEx;
/*DSG{{*/
mainForm = win.form(text="vlistEx - table adapter";right=849;bottom=578;)
mainForm.add(
button={cls="button";text="Button";left=360;top=512;right=488;bottom=560;z=2;};
vlist={cls="vlistEx";left=10;top=10;right=840;bottom=496;db=1;dl=1;dr=1;dt=1;edge=1;transparent=1;z=1;};
)
/*}}*/
var t = { fields={"序号","姓名","年龄","地址","身份证"} };
for(i=1;100;1){
var tt={};
tt["序号"]="[@rowindex]"; // 行序号标记是不允许编辑修改的
tt["姓名"]=math.random(1000,9999)+"姓名";
tt["年龄"]=math.random(10,99);
tt["地址"]=math.random(1000,9999)+"地址";
tt["身份证"]=math.random(1000,9999)+"身份证";
..table.push(t,tt);
}
mainForm.vlist.setTable(t,,{80,100,100,100,200},0x2);
mainForm.button.oncommand = function(id,event){
import console
console.dump(mainForm.vlist.getVisibleItemsRange())
}
mainForm.show();
win.loopMessage();