$(document).on('page:init', '.page[data-name="address"]', async function (e) {

  console.log('app address ready')

  var view = app.views.current



  let js = JSON.parse(localStorage.getItem('f03_user'));

  let dt = js.data.address;

  //console.log(dt)

  var strHtml = `<div class="list detailed-list list-dividers full-width">

      <ul>`;

  for(let i=0;i<dt.length;i++) {

    strHtml += `

<li>

<div class="item-link item-content">

    

    <div class="item-inner">

      <div class="item-title">

        <div class="item-name"><b>`+dt[i].label+` [`+dt[i].name+`, `+dt[i].phone+`]</b></div>

        <div class="item-footer">`+dt[i].address+`, `+dt[i].rt+`, `+dt[i].rw+`, `+dt[i].no+`, `+dt[i].kel+`, `+dt[i].kec+`, `+dt[i].city+`, `+dt[i].postcode+`</div>

      </div>

      <div class="item-after event-time">

      <a href="/address_edit/`+dt[i].id+`" data-id="`+dt[i].id+`" class="badge bg-primary btn-f300">edit</a>

      <a data-id="`+dt[i].id+`" class="badge bg-danger btn-f300 ml-2 user_address_delete">del</a>

      </div>

    </div>

   </div>

</li>   

    `;

  }

   strHtml += `

   </ul></div>`;  

  //console.log(strHtml)

  $$("#address_content").html(strHtml);

})