虚表 —— null排序

光庆 10月前 893

Code AardioLine:35复制
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
    • import win.ui;
    • import godking.vlistEx;
    • /*DSG{{*/
    • mainForm = win.form(text="vlistEx - table adapter";right=849;bottom=578)
    • mainForm.add(
    • vlist={cls="vlistEx";left=10;top=10;right=840;bottom=570;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(0,1)?(math.random(1000,9999)+"姓名"):null;
    • tt["年龄"]=math.random(0,1)?math.random(10,99):null;
    • tt["地址"]=math.random(0,1)?(math.random(1000,9999)+"地址"):null;
    • tt["身份证"]=math.random(0,1)?(math.random(1000,9999)+"身份证"):null;
    • ..table.push(t,tt);
    • }
    • mainForm.vlist.setTable(t,,{80,100,100,100,200},0x2);
    • mainForm.vlist.checkBox.show = true;
    • mainForm.vlist.textColor = 0xFF0000;
    • mainForm.vlist.setHeaderHeight(50);
    • mainForm.vlist.headerAlign = 1;
    • mainForm.vlist.lineColorH = 0x008800;
    • mainForm.vlist.lineColorV = 0xBB9999;
    • mainForm.vlist.fillParent();
    • mainForm.vlist.onSortColumn = function(col,desc){
    • /*点击列标题进行排序。col:列号,从1开始。desc:是否倒序。返回false则禁止排序*/
    • if col>1 owner.sort( col, desc, 0 /*数据转换:0默认 1时间 2数值 3文本*/ ,false /*使用微软api进行文本排序*/ ,desc /*null值排序位置,false靠前,true靠后*/);
    • else return false;
    • }
    • mainForm.show();
    • win.loopMessage();


    最新回复 (2)
    • ccbwx 10月前
      0 引用 2

      光大师,为什么我运行出错?已经最新版了

    • 光庆 10月前
      0 引用 3
      等我修复一下
    返回