Вот как вы это делаете, с закругленными углами и закругленными тенями, не беспокоясь о путях.
//Inner view with content
[imageView.layer setBorderColor:[[UIColor lightGrayColor] CGColor]];
[imageView.layer setBorderWidth:1.0f];
[imageView.layer setCornerRadius:8.0f];
[imageView.layer setMasksToBounds:YES];
//Outer view with shadow
UIView* shadowContainer = [[UIView alloc] initWithFrame:imageView.frame];
[shadowContainer.layer setMasksToBounds:NO];
[shadowContainer.layer setShadowColor:[[UIColor blackColor] CGColor]];
[shadowContainer.layer setShadowOpacity:0.6f];
[shadowContainer.layer setShadowRadius:2.0f];
[shadowContainer.layer setShadowOffset: CGSizeMake(0.0f, 2.0f)];
[shadowContainer addSubview:imageView];
Вид с содержимым, в моем случае UIImageView, имеет радиус угла и поэтому должен маска к границам.
Мы создаем еще один одинаковый размер для теней, устанавливаем его maskToBounds в NO, а затем добавляем представление содержимого в представление контейнера (например, shadowContainer).
только что отредактировал $('#CategoryName').on('change'...
часть
var tableData = [{
"Item Code": "1001",
"Item Name": "Beverages",
"Quantity": "0"
},
{
"Item Code": "2003",
"Item Name": "Juices",
"Quantity": "0"
},
{
"Item Code": "1004",
"Item Name": "Soups",
"Quantity": "0"
},
{
"Item Code": "2005",
"Item Name": "Cookies",
"Quantity": "0"
},
]
function addTable(tableData) {
var col = Object.keys(tableData[0]);
var countNum = col.filter(i => !isNaN(i)).length;
var num = col.splice(0, countNum);
col = col.concat(num);
var table = document.createElement("table");
var tr = table.insertRow(-1); // TABLE ROW.
for (var i = 0; i < col.length; i++) {
var th = document.createElement("th"); // TABLE HEADER.
th.innerHTML = col[i];
tr.appendChild(th);
tr.classList.add("text-center");
tr.classList.add("head")
}
for (var i = 0; i < tableData.length; i++) {
tr = table.insertRow(-1);
for (var j = 0; j < col.length; j++) {
let tabCell = tr.insertCell(-1);
var hiddenField = document.createElement("input");
hiddenField.style.display = "none";
var tabledata = tableData[i][col[j]];
if (tableData[i]['Item Code'] === tableData[i][col[j]]) {
tabCell.innerHTML = tabledata;
hiddenField.setAttribute('name', 'Item_Code');
hiddenField.setAttribute('value', tabledata);
tabCell.appendChild(hiddenField);
}
if (tableData[i]['Item Name'] === tableData[i][col[j]]) {
tabCell.innerHTML = tabledata;
hiddenField.setAttribute('name', 'Item_Name');
hiddenField.setAttribute('value', tabledata);
tabCell.appendChild(hiddenField);
}
if (tableData[i]['Quantity'] === tableData[i][col[j]]) {
var quantityField = document.createElement("input");
quantityField.style.border = "none";
quantityField.style["text-align"] = "center";
quantityField.setAttribute('name', 'Quantity');
quantityField.setAttribute('value', tabledata);
quantityField.setAttribute('type', 'number');
quantityField.classList.add("dataReset");
tabCell.appendChild(quantityField);
/* console.log(quantityField) */
}
if (j > 1)
tabCell.classList.add("text-right");
}
}
var divContainer = document.getElementById("HourlysalesSummary");
divContainer.innerHTML = "";
divContainer.appendChild(table);
table.classList.add("table");
table.classList.add("table-striped");
table.classList.add("table-bordered");
table.classList.add("table-hover");
}
addTable(tableData);
$('#CategoryName').on('change', function() {
//you need to structure the data somehow
// and iterate over each input, if not , val() will act like .first().val() (just returning the value of the first input)
var testing = [];
$(".dataReset").each(function(u,itm){
testing.push($(itm).val());
});
console.log(testing);
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css">
<form action="InsertQuantityIndent" method="post" id="form1">
<div class="row position-relative">
<div class="col-lg-4">
<h5>Category</h5>
<select class="test" id="CategoryName" name="categoryCode">
<option>All</option>
<option>Cat1</option>
<option>Cat2</option>
</select>
</div>
</div>
<br>
<div class="table-responsive">
<table class=" w-100" id=HourlysalesSummary></table>
</div>
<div>
<button type="submit" id="save">
<i class="fas fa-save"></i> Save
</button>
</div>
</form>
$(".dataReset")
представляет собой список объектов jQuery. Вам нужно перебрать их:
$.each(".dataReset", (index,element) => console.log( $(element).val() ) )