<canvas>
  <include href="restgrid.lzx" />

  <attribute name="baseurl" value="http://127.0.0.1:3000" type="string" />

  <dataset name="customerdata" request="false" />

  <restgrid name="customers" datapath="customerdata:/customers" width="500" height="200"
            baseurl="${canvas.baseurl + '/customers/'}">
    <gridtext text="名字" datapath="last-name/text()" />
    <gridtext text="名前" datapath="first-name/text()" />
    <gridtext text="住所" datapath="address/text()" width="120" />
    <gridtext text="電話番号" datapath="tel/text()" width="100" />
    <gridtext text="PCメール" datapath="mail/text()" width="120" />
  </restgrid>

  <button text="リロード" y="210" onclick="canvas.getdata()" />
  <button text="新規レコード作成" x="70" y="210" onclick="canvas.customers.createdata()" />

  <method name="getdata">
    customerdata.setSrc(baseurl+ '/customers.xml');
    customerdata.setQueryType("get");
    customerdata.doRequest();
  </method>

  <handler name="oninit">
    this.getdata()
  </handler>
</canvas>