I'd like to affect all items in the array. The end result will be to decodeURIcomponent
on each item.
It's not working for me so I decided to change the value of each item to check the code. It doesn't change anything.
Is there a better way of doing this, as really nested $.each
functions seems a bit redundant to me.
$(function() {
var hResponse = [];
hResponse.push("firstName", "lastName", "location");
var columns = [];
columns.push({
"firstName": "Edward",
"lastName": "Dane",
"location": " Here"
}, {
"firstName": "Arthur",
"lastName": "Dee",
"location": "There"
}, {
"firstName": "Cherry",
"lastName": "Red",
"location": "OverHere"
});
$.each(columns, function (key, value) {
$.each(value, function (key1, value2) {
value2 = "Meeeeep";
//value2 = decodeURIComponent(value2);
});
});
$('#my-table').dynatable({
dataset: {
records: columns
}
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<link href="https://s3.amazonaws.com/dynatable-docs-assets/css/jquery.dynatable.css" rel="stylesheet"/>
<script src="https://s3.amazonaws.com/dynatable-docs-assets/js/jquery.dynatable.js"></script>
<table id="my-table">
<thead>
<th>FirstName</th>
<th>LastName</th>
</thead>
<tbody></tbody>
</table>
<br>