Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm working on a filter and I'm stuck.
I've worked on a html filter and javascript that works for filtering, however it doesn't work on Umbraco for obvious reasons.
@inherits UmbracoTemplatePage @using ClientDependency.Core.Mvc @{ var schools = CurrentPage.Children.OrderBy("kommun"); } <dl> <dt> <a href="#"> <span class="hida">Select</span> <p class="multiSel"></p> </a> </dt> <dd> <div class="mutliSelect"> <ul> <li> <input name="tablefilter" type="checkbox" value="Linköping" id='tablefilter1' checked />Linköping </li> <li> <input name="tablefilter" type="checkbox" value="Norrköping" id='tablefilter2' checked />Norrköping </li> <li> <input name="tablefilter" type="checkbox" value="Mjölby" id='tablefilter3' checked />Mjölby </li> </ul> </div> </dd> </dl> <div id="no-more-tables" class="sorttable"> <table> <thead> <tr> <th style="width: 15%;" data-sort-initial="true"> Kommun </th> <th style="width: 20%;"> Skola </th> <th style="width: 15%;"> Datum </th> <th style="width: 15%;" data-sort-ignore="true"> Tid </th> <th style="width: 20%;" data-sort-ignore="true"> Adress </th> <th style="width: 15%;" data-sort-ignore="true"> Övrigt </th> </tr> </thead> <tbody id='tablebody'> @foreach (var school in schools) { var times = school.Children.Where("date > DateTime.Now.Date").OrderBy("date"); foreach (var time in times) { <tr> <td data-title="Kommun"> @if (!string.IsNullOrEmpty(school.kommun)) { @school.kommun } else { <text> </text> } </td> <td data-title="Skola"> @if (!string.IsNullOrEmpty(school.Name)) { @school.Name } else { <text> </text> } </td> <td data-title="Datum"> @if (time.date != null) { @time.date.ToString("yyyy-MM-dd") } else { <text> </text> } </td> <td data-title="Tid"> @if (!string.IsNullOrEmpty(time.time)) { @time.time } else { <text> </text> } </td> <td data-title="Adress"> @if (!string.IsNullOrEmpty(school.adress)) { @school.adress } else { <text> </text> } </td> <td data-title="Övrigt"> @if (!string.IsNullOrEmpty(school.oevrigt.ToString())) { @school.oevrigt } else { <text> </text> } </td> </tr> } } </tbody> </table> </div>
The problem is the table:
<td data-title="Kommun"> @if (!string.IsNullOrEmpty(school.kommun)) { @school.kommun } else { <text> </text> } </td>
Normal html and JavaScript can't read it. It's a document type. How can I make it readable for the HTML and javascript?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
How to make javascript and HTML read document type?
I'm working on a filter and I'm stuck.
I've worked on a html filter and javascript that works for filtering, however it doesn't work on Umbraco for obvious reasons.
The problem is the table:
Normal html and JavaScript can't read it. It's a document type. How can I make it readable for the HTML and javascript?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.