$(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('f01_user'));

  let dt = js.data.address;

  //console.log(dt)

  var strHtml = ``;

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

    strHtml += `

    <div class="card card-raised" id="adrs_`+dt[i].id+`">

      <div class="card-content card-content-padding">

        <p><b>`+dt[i].label+` [`+dt[i].name+`, `+dt[i].phone+`]</b></p>

        <p>`+dt[i].address+`, `+dt[i].rt+`, `+dt[i].rw+`, `+dt[i].no+`, `+dt[i].kel+`, `+dt[i].kec+`, `+dt[i].city+`, `+dt[i].postcode+`</p>

      </div>

      <div class="card-footer"><a href="/address_edit/`+dt[i].id+`" class="btn btn-sm btn-warning user_address_edit" data-id="`+dt[i].id+`">Edit</a><a class="btn btn-sm btn-danger user_address_delete" data-id="`+dt[i].id+`">Delete</a></div>

    </div>`;

  }

   strHtml += `

   <div class="separator-large"></div>`;  

  //console.log(strHtml)

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

})