zoukankan      html  css  js  c++  java
  • zk 3.6数据绑定

    官网提供了listbox的数据绑定,测试了下相当不错,再试试grid绑定和自动排序。

    zul页面

    <?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?>
    <window id="win" use="com.udooo.window.BookWindow" title="ZK Tutorial" width="1024px" border="normal">
        <listbox model="@{win.books}">
            <listhead sizable="true">
                <listheader label="名称" width="100px" sort="auto(name)" />
                <listheader label="作者" width="250px" sort="auto(author)" />
                <listheader label="出版社" width="250px" sort="auto(pub)" />
                <listheader label="价格" width="250px" sort="auto(price)" />
            </listhead>
            <listitem self="@{each=book}">
                <listcell label="@{book.name}" />
                <listcell label="@{book.author}" />
                <listcell label="@{book.pub}" />
                <listcell label="@{book.price}" />
            </listitem>
        </listbox>
        <space/>
        <grid model="@{win.books}" rowRenderer="com.udooo.renderer.BookRenderer">
            <columns menupopup="auto">
                <column label="名称" sort="auto(name)"/>
                <column label="作者"/>
                <column label="出版社"/>
                <column label="价格"/>
            </columns>
        </grid>
    </window>

    grid要绑定数据关键是要指定Rowrenderer就好了。

    参考文章:

    http://en.wikibooks.org/wiki/ZK/How-Tos/Data-Binding

  • 相关阅读:
    pwnable.kr之input
    pwnable.kr之bof
    pwnable.kr之fd
    运维及服务器组成详解
    查看锁信息(开启InnoDB监控)
    【原创】记一次MySQL大表高并发写入引发CPU飙升的排障过程
    【原创】获取MySQL crash 时的core file
    【原创】MySQL Replay线上流量压测工具
    python面向对象
    TCP三次握手与四次挥手
  • 原文地址:https://www.cnblogs.com/okuc/p/4149349.html
Copyright © 2011-2022 走看看