Skip to content

Instantly share code, notes, and snippets.

@moshiurse
Created February 12, 2020 07:07
Show Gist options
  • Save moshiurse/670c49201d4794d914018e1521d3f74c to your computer and use it in GitHub Desktop.
Save moshiurse/670c49201d4794d914018e1521d3f74c to your computer and use it in GitHub Desktop.
Get data from request and converting to array using key value
var url1 = "<?php echo base_url('issue/UnitDemandController/subdepotWiseStoreOrg') . '/'; ?>" + orgID + '/' + vocab_id;
$.ajax({
url: url1,
type:'post',
datatype:'json',
async: false,// without it array cannot process on time
success: function(result){
var i=0;
JSON.parse(result).map(item => {
storeArrayList[item.store_id] = item;
})
}
});
console.log(storeArrayList);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment