模仿queryAction
如果queryAction不能满足获取数据的需求,就需要自定义action,在action中仅仅返回table,再通过data组件的loadXML方法装入数据,和执行queryAction的效果是不同的,原因是还需要进行一些设置,按照下面的方法进行设置,可以获得和queryAction同样的效果。 1 设置rowid </pre> Table table = KSQL.select("select X5_GoodsType.* from X5_GoodsType X5_GoodsType",null, "/x5demo/rich/data", null); return table; <pre> 仅仅这样写,放入data后,grid会把fid列显示出来,此时使用data.getID(),得不到值,说明系统不知道fid是rowid,需要增加一句代码。如下: Table table = KSQL.select("select X5_GoodsType.* from X5_GoodsType X5_GoodsType",null, "/x5demo/rich/data", null); //设置table的rowid属性 table.getProperties().put(Table.PROP_NAME_ROWID, "X5_GoodsType"); return table; [...]