Dear All.
I have a listview within the listview items are displayed. This is my current code for the html.
<section> <script type="text/x-kendo-tmpl" id="templateRC"> <div id="selectedRC" class=" SetHeight"> <span>#:ID#</span> </div> </script> <div class="demo-section k-content wide"> @(Html.Kendo().ListView<SLM.Models.ViewModel>() .Name("listView") .TagName("div") .ClientTemplateId("templateRC") .DataSource(dataSource => dataSource .Ajax() .Read(read => read.Action("_Reports_Chart", "Home", new { iTypeID = Model.TYPE2_ID }) ) ) .Selectable(ListViewSelectionMode.Single) // .Events(events => events.Change("onSelectReport")) ) </div> </section>My css Code:
.SetHeight { width: calc(50% - 3%); border: 1px solid #008000; margin: 1%; float: left;}When I check my browser the items will displayed like rectangles, so theyre not equal width and height. I tried adding some javascript to get the width and use it for the height but it keeps displaying like a rectangle.
The Jquery:
$(function () { var divWidth = $('.SetHeight').width(); $('.SetHeight').height(divWidth); console.log(divWidth);});
(logging also returns null. When I create a custom project on codepen. it does work for some reason.)
So now is my question: What do I need to change/add/remove to make the boxes equal width and height(squares).
Kind regards. Bjorn