I'm currently working on an app using Angular.js and HTML, but I've hit a roadblock.
There's a dropdown at the top, and when it changes, I want to adjust the background color of certain cells as shown in this image: https://i.sstatic.net/OvhPH.png
Below is a snippet of my code:
HTML page
<div class="row">
<div class="col col1" style="-webkit-box-shadow: 0 0 20px 0px #999;background-color: #11c1f3;text-align: center;">
<h3 style="color: white">Time Slot</h3>
</div>
<div class="col col1" ng-repeat="time in timeArray" style="background-color: #e0e0e0;text-align: center">
{{time}}
</div>
</div>
<!-- <div id="selectedDateRange"> -->
<div class="row" ng-repeat="(dateindex, date) in dateArray">
<div class="col col1" style="-webkit-box-shadow: 0 0 20px 0px #999;background-color: #11c1f3;text-align: center;">
<h3 style="color: white">{{date}}</h3>
</div>
<div class="col col1" ng-repeat="(timeindex, time) in timeArray" ng-click="selectCell(dateindex, timeindex)" ng-class="{'selected': selectedCell[0] == datein
dex && selectedCell[1] == timeindex}"></div>
</div>
Controller.js code
Here is the click event for the dropdown change:
$(function () {
$('#seldate').change(function () {
//I need to change the color of the cell in the first row and first column
//also, the color of the cell in the second row and second column should change
})
})
Any suggestions on how to change the background color of a cell?
Your help would be greatly appreciated! Thank you in advance!!