ASP.NET call an #id from a tag - asp.net-mvc

I have a little problem - I build a shopping cart checkout with 4 steps (with stepper and links to partial views).
Now I have to call a special #id (the attribute of tags) from the redirectToAction...
How is this possible?
the thing is - I'm in step 2 (partial view) and call an actionresult, which redirect me to the "main view" - but I have to go to the 2nd or 3rd step.
Is there a way how to handle this?
Tried already to overload the button, so the href call the link and an onclick function() calls the actionresult, but this is not possible
Also tried to give the #id as a route value, but it seems doesn't work...
<script>
function goBack() {
window.history.back();
}
//Initialize tooltips
//$('.nav-tabs > li a[title]').tooltip();
//Wizard
$('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
var $target = $(e.target);
if ($target.hasClass('disabled')) {
return false;
}
});
$(".next-step").click(function (e) {
var $active = $('.wizard .nav-tabs .nav-item .active');
var $activeli = $active.parent("li");
$($activeli).next().find('a[data-toggle="tab"]').removeClass("disabled");
$($activeli).next().find('a[data-toggle="tab"]').click();
});
$(".prev-step").click(function (e) {
var $active = $('.wizard .nav-tabs .nav-item .active');
var $activeli = $active.parent("li");
$($activeli).prev().find('a[data-toggle="tab"]').removeClass("disabled");
$($activeli).prev().find('a[data-toggle="tab"]').click();
});
</script>
<form class="form cf">
<div class="wizard">
<!-- ============================================================ NAVIGATION ============================================================ -->
<div class="wizard-inner">
<div class="connecting-line"></div>
<ul class="nav nav-tabs" role="tablist">
<!-- ======================================== Schritt 1 - Warenkorb ======================================== -->
<li role="presentation" class="nav-item">
<a href="#step1" data-toggle="tab" aria-controls="step1" role="tab" title="Step 1" class="nav-link active navigation">
<span class="round-tab">
<i class="fa fa-lg fa-shopping-cart"></i>
</span>
</a>
</li>
<!-- ======================================== Schritt 2 - Ausleihdatum ======================================== -->
<li role="presentation" class="nav-item">
<a href="#step2" data-toggle="tab" aria-controls="step2" role="tab" title="Step 2" class="nav-link navigation disabled" id="schritt">
<span class="round-tab">
<i class="fa fa-lg fa-calendar-check-o"></i>
</span>
</a>
</li>
<!-- ======================================== Schritt 3 - Rechnung- und Lieferadresse ======================================== -->
<li role="presentation" class="nav-item">
<a href="#step3" data-toggle="tab" aria-controls="step3" role="tab" title="Step 3" class="nav-link navigation disabled">
<span class="round-tab">
<i class="fa fa-lg fa-address-card-o"></i>
</span>
</a>
</li>
<!-- ======================================== Schritt 4 - Bezahlmöglichkeit ========================================
<li role="presentation" class="nav-item">
<a href="#step4" data-toggle="tab" aria-controls="step4" role="tab" title="Step 4" class="nav-link disabled">
<span class="round-tab">
<i class="fa fa-lg fa-money"></i>
</span>
</a>
</li>
<!-- ======================================== Schritt 5 - Abschluss ======================================== -->
<li role="presentation" class="nav-item">
<a href="#step4" data-toggle="tab" aria-controls="step4" role="tab" title="Step 4" class="nav-link disabled navigation">
<span class="round-tab">
<i class="fa fa-check"></i>
</span>
</a>
</li>
</ul>
</div>
<!-- ============================================================ CONTENT ============================================================ -->
<!-- ======================================== Schritt 1 - Warenkorb ======================================== -->
<div class="tab-content ">
<div class="tab-pane active text-center " role="tabpanel" id="step1">
<h2>Warenkorb</h2>
<div class="row">
</div>
#if (Model.VmWarenkorbIndexListe.Count == 0)
{
<br />
<br />
<h1 class="text-center">Leider haben Sie noch keine Bücher im Warenkorb :-(</h1>
<br />
<h2 class="text-center">Hier können Sie nach Büchern suchen :-)</h2>
}
else
{
<div class="container">
<table id="cart" class="table table-hover table-condensed ">
<thead>
<tr>
<th></th>
<th style="width:40%" class="h4 text-left">#Html.DisplayName("Titel")</th>
<th class="text-center h5" style="width:3%">#Html.DisplayName("Ausgabe")</th>
<th class="text-center h5" style="width: 20%">#Html.DisplayName("ISBN")</th>
<th class="text-center h5" style="width:10%">#Html.DisplayName("Preis")</th>
<th class="text-center h5">#Html.DisplayName("Anzahl")</th>
<th class="text-center h5">#Html.DisplayName("Zeilenpreis")</th>
<th></th>
</tr>
</thead>
<tbody class="border-bottom">
#foreach (var buch in Model.VmWarenkorbIndexListe)
{
<tr>
<td data-th="Bild" class="zoom">
<img src="#buch.BildPfad" alt="#buch.BildAltText" width="70" onclick="location.href = '#(Url.Action("Detail", "Buch", new { buchId = buch.Id }))'" />
</td>
<td data-th="Buch" class="align-middle" data-toggle="tooltip" data-placement="bottom" title="Für Beschreibung bitte klicken">
<h6 class="nomargin text-left" data-toggle="collapse" data-target="#buch">#buch.Titel</h6>
<p class="collapse" id="buch">Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Lorem ipsum dolor sit amet.</p>
</td>
<td data-th="Ausgabe" class="text-center align-middle h6">#buch.Ausgabe</td>
<td data-th="ISBN" class="text-center align-middle h6">#buch.Isbn</td>
<td data-th="Preis" class="text-center align-middle h6">#buch.PreisProTag.ToString("F2") €</td>
<td data-th="Anzahl" class="text-center align-middle h6">#buch.Anzahl</td>
<td data-th="Zeilenpreis" class="text-right align-middle h6">#buch.ZeilenPreisProTag.ToString("F2") €</td>
<td class="actions align-middle" data-th="">
<a class="btn btn-outline-danger " href="/Warenkorb/Entfernen?buchId=#buch.Id&anzahl=1" role="button" aria-expanded="false">
<i class="fa fa-lg fa-minus-square"></i>
</a>
<a class="btn btn-danger " href="/Warenkorb/Entfernen?buchId=#buch.Id&anzahl=#buch.Anzahl" role="button" aria-expanded="false">
<i class="fa fa-lg fa-cart-arrow-down"></i>
</a>
</td>
</tr>
}
</tbody>
<tfoot>
<tr>
<td colspan="5"></td>
<td class="hidden-xs"><strong class="h4 text-primary">Gesamtpreis </strong></td>
<td class="hidden-xs text-right"><strong class="h4 text-primary"> #Model.VmWarenkorbIndexListe.Sum(s => s.ZeilenPreisProTag).ToString("F2") €</strong></td>
<td></td>
</tr>
<tr>
<!-- ======================================== Schritt 2 - Ausleihdatum ======================================== -->
<td> <a onclick="goBack()" class="btn btn-warning "><i class="fa fa-angle-left"></i> Weiter einkaufen</a></td>
<td colspan="6"></td>
<td class="wizard-inner">
Jetzt Bestellen <i class="fa fa-angle-right"></i>
</td>
</tr>
</tfoot>
</table>
</div>
}
</div>
<!-- ======================================== Schritt 2 - Ausleihdatum ======================================== -->
#Html.Partial("_Bestellen", Model)
<!-- ======================================== Schritt 3 - Rechnung- und Lieferadresse ======================================== -->
#Html.Partial("_Rechnungsdaten", Model)
<!-- ======================================== Schritt 4 - Bezahlmöglichkeit ========================================
<div class="tab-pane" role="tabpanel" id="step4">
<h1 class="text-md-center">Step 4</h1>
<div class="row">
</div>
<ul class="list-inline text-md-center">
<li><button type="button" class="btn btn-lg btn-common next-step next-button">Next Step</button></li>
</ul>
</div>
-->
#Html.Partial("_Danke")
</div>
</div>
</form>
here is the Main View
and here is a partial view
<div class="tab-pane text-center" role="tabpanel" id="step2">
<h2>Ihre Bestellung </h2>
<div class="row">
#using (Html.BeginForm("Bestellen", "Warenkorb", FormMethod.Post))
{
<div class="container">
<div></div>
<table id="cart" class="table table-hover table-condensed ">
<thead>
<tr>
<th style="width:20%" class="h4 text-left">#Html.DisplayName("Titel")</th>
<th class="text-center h5" style="width:20%">#Html.DisplayName("ISBN")</th>
<th class="text-left h5" style="width: 20%">#Html.DisplayName("Autoren")</th>
<th class="text-center h5" style="width: 5%">#Html.DisplayName("Ausgabe")</th>
<th class="text-center h5">#Html.DisplayName("Anzahl")</th>
<th class="text-center h5">#Html.DisplayName("Zeilenpreis")</th>
<th class="text-center h5">
#Html.DisplayName("Rückgabedatum")
</th>
</tr>
</thead>
<tbody class="border-bottom">
#foreach (var buch in Model.VmBestellen.Warenkorb)
{
<tr>
<td data-th="Buch" class="align-middle">
<h6 class="nomargin text-left">#buch.Titel</h6>
</td>
<td data-th="ISBN" class="text-center align-middle h6">#buch.ISBN</td>
<td data-th="Autoren" class="align-middle h6">
#foreach (var autor in buch.Autoren)
{
<span>#autor<br /></span>
}
</td>
<td data-th="Ausgabe" class="text-center align-middle h6">#buch.Ausgabe</td>
<td data-th="Anzahl" class="text-center align-middle h6">#buch.Anzahl</td>
<td data-th="Zeilenpreis" class="text-right align-middle h6">#buch.ZeilenPreisProTagNetto.ToString("F2") €</td>
<td data-th="Datum">
#Html.EditorFor(model => model.VmBestellen.RueckgabeDatum, new { htmlAttributes = new { #type = "date", #name = "rueckgabedatum", #value = Model.VmBestellen.RueckgabeDatum.ToString("dd.MM.yyyy"), #class = "form-control" } })
#Html.ValidationMessageFor(model => model.VmBestellen.RueckgabeDatum, "", new { #class = "text-danger" })
<button type="submit" formmethod="get"> Datum ändern</button>
</td>
</tr>
}
</tbody>
<tfoot>
<tr>
<td colspan="3" class="hidden-xs"></td>
<td class="hidden-xs" colspan="2"><strong class="h5 ">Preis <strong class="h6">(exkl. Mwst)</strong> </strong></td>
<td class="hidden-xs text-right"><strong class="h5 "> #Model.VmBestellen.Warenkorb.Sum(s => s.ZeilenPreisProTagNetto).ToString("F2") €</strong></td>
<td class="hidden-xs"> <strong class="h5">Beginn: <bdi class="text-primary">#DateTime.Now.ToShortDateString() </bdi></strong></td>
</tr>
<tr>
<td colspan="3" class="hidden-xs"></td>
<td class="hidden-xs" colspan="2"><strong class="h6 ">Rabatt </strong></td>
<td class="hidden-xs text-right"><strong class="h6 "> - Rabatt -</strong></td>
<td class="hidden-xs"><strong class="h5">Ende: <bdi class="text-primary ">#Model.VmBestellen.RueckgabeDatum.ToShortDateString() </bdi></strong></td>
</tr>
<tr>
<td colspan="3" class="hidden-xs"></td>
<td class="hidden-xs" colspan="2"><strong class="h6 ">Mwst </strong></td>
<td class="hidden-xs text-right"><strong class="h6 "> #Model.VmBestellen.MwstBetrag.ToString("F2") €</strong></td>
<td class="hidden-xs"><strong class="h5"> Tage Gesamt: <bdi class="text-primary">XX</bdi> </strong> </td>
</tr>
<tr>
<td colspan="3" class="hidden-xs"></td>
<td class="hidden-xs" colspan="2"><strong class="h4 text-primary">Preis <strong class="h6 text-primary">(inkl. Mwst)</strong> </strong></td>
<td class="hidden-xs text-right"><strong class="h4 text-primary"> #Model.VmBestellen.GesamtpreisBrutto.ToString("F2") €</strong></td>
<td></td>
</tr>
<tr>
<!-- ======================================== Schritt 3 - Abschluss ========================================-->
<td > <a onclick="goBack()" class="btn btn-warning btn-block "><i class="fa fa-angle-left"></i> Zurück zum Warenkorb</a></td>
<td colspan="5"></td>
<td class="wizard-inner">
Bestellung abschließen <i class="fa fa-angle-right"></i>
</td>
</tr>
</tfoot>
</table>
</div>
}
</div>
</div>
here is the a href - which calls at the moment only a link - but i would need to call the link AND with the same click call an POST-ActionResult
i thought i could call the POST ActionResult and from there Redirect to a specific #id

Related

MVC5 Bootstrap collapsible with dynamic class

I am having my view bound to datatable as follows
#{int i = 1;}
#foreach (var item in Model.Rows)
{
<div class="panel-group" id="accordion">
<div class="panel panel-default">
<div class="panel-heading bg-info">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse#(i)">
<div class="col-lg-3">
<img style="width:50px" class="float-left p-l-5" src="https://organicthemes.com/demo/profile/files/2012/12/profile_img.png" /> <div class="float-left p-l-10">
<h4 class="m-t-0">#item["First_Name"]</h4>
<p><b>##item["Employee_Code"]</b></p>
</div>
</div>
<div class="col-lg-4">
<h4 class="m-t-0">#item["Leave_Description"]: #item["No_Of_Days"] days - <span class="blue_heading">#item["Start_date"]</span></h4>
<h4 class="m-t-0">#item["Leave_Purpose"]</h4>
</div>
<div class="col-lg-4">
</div>
</a>
</div>
<div id="collapse#(i)" class="panel-collapse collapse">
<div class="panel-body">
<div class="center_table">
<div class="border_table">
<table class="table table-hover table-expandable table-striped">
<tr>
<td>
Leave Type: #item["Leave_Description"]
</td>
<td>
Days : #item["No_Of_Days"]
</td>
</tr>
<tr>
<td>
From : #item["Start_Date"]
</td>
<td>
To : #item["End_Date"]
</td>
</tr>
<tr>
<td colspan="2">Reason : #item["Leave_Purpose"]</td>
</tr>
</table>
</div>
<div class="clearfix"></div>
<div class="well text-center p-10"><button type="button" class="btn btn-default">Accept Grant</button> <button type="button" class="btn btn-default">Reject</button></div>
</div>
</div>
</div>
</div>
</div>
i++;
}
I am getting the required output but when clicking on first row the second row is also showing as collapsed. My scenario is when there are multiple rows on clicking a particular row other rows collapse should be hidden.
Can someone tell what change do I need to achieve the scenario?
Can you try
i=i+1;
Sometime foreach confuses with ++ operator
Also you can try collapse-#i instead of #collapse#(i)

Navigation broken in Sitecore Page Editor during Edit related item

After updating Sitecore 6.3 to 6.6, the Main Navigation is broken in the Sitecore Page Editor when "Edit related item" is clicked.
It looks like this:
It even stays like this when closing the "Edit related item" frame.
Here is the text from that screen:
{"commands":[{"click":"chrome:common:edititem({command:\"webedit:open\"})","header":"","icon":"/~/icon/SoftwareV2/16x16/cubes_blue.png.aspx","isDivider":false,"tooltip":"Dieses Item im Content Editor bearbeiten.","type":"common"}],"contextItemUri":"sitecore://master/{78EBD797-ACA9-40BC-9ACE-961CD2296CDC}?lang=de-CH&ver=1","custom":{},"displayName":"Title","expandedDisplayName":null}KATA {"commands":[{"click":"chrome:common:edititem({command:\"webedit:open\"})","header":"","icon":"/~/icon/SoftwareV2/16x16/cubes_blue.png.aspx","isDivider":false,"tooltip":"Dieses Item im Content Editor bearbeiten.","type":"common"}],"contextItemUri":"sitecore://master/{F195AD36-86EE-4C13-883B-761E300C23AF}?lang=de-CH&ver=1","custom":{},"displayName":"Title","expandedDisplayName":null}REA {"commands":[{"click":"chrome:common:edititem({command:\"webedit:open\"})","header":"","icon":"/~/icon/SoftwareV2/16x16/cubes_blue.png.aspx","isDivider":false,"tooltip":"Dieses Item im Content Editor bearbeiten.","type":"common"}],"contextItemUri":"sitecore://master/{63438A98-FC6F-461D-89BB-7497B12FBAEF}?lang=de-CH&ver=1","custom":{},"displayName":"Title","expandedDisplayName":null}Patientensicherheit {"commands":[{"click":"chrome:common:edititem({command:\"webedit:open\"})","header":"","icon":"/~/icon/SoftwareV2/16x16/cubes_blue.png.aspx","isDivider":false,"tooltip":"Dieses Item im Content Editor bearbeiten.","type":"common"}],"contextItemUri":"sitecore://master/{FB9B0590-E933-4141-BA2B-F82C83A3343E}?lang=de-CH&ver=1","custom":{},"displayName":"Title","expandedDisplayName":null}Prozesse {"commands":[{"click":"chrome:common:edititem({command:\"webedit:open\"})","header":"","icon":"/~/icon/SoftwareV2/16x16/cubes_blue.png.aspx","isDivider":false,"tooltip":"Dieses Item im Content Editor bearbeiten.","type":"common"}],"contextItemUri":"sitecore://master/{0F1334E0-9BB7-4657-9DC4-884F6E1133C9}?lang=de-CH&ver=1","custom":{},"displayName":"Title","expandedDisplayName":null}Dokumente {"commands":[{"click":"chrome:common:edititem({command:\"webedit:open\"})","header":"","icon":"/~/icon/SoftwareV2/16x16/cubes_blue.png.aspx","isDivider":false,"tooltip":"Dieses Item im Content Editor bearbeiten.","type":"common"}],"contextItemUri":"sitecore://master/{8D18489B-B7F3-442B-9958-7D1FDBDC9010}?lang=de-CH&ver=1","custom":{},"displayName":"Title","expandedDisplayName":null}Telefonlisten
Anyone knows what this is and how I can fix it?
Thanks in advance :)
EDIT:
Code of .ascx:
<%# Control Language="C#" AutoEventWireup="true"
CodeBehind="Header.ascx.cs" Inherits="ZGKS.Intranet.WebApp.Frontend.sublayouts.Header" %>
<%# Register Src="NavLayer.ascx" TagName="NavLayer" TagPrefix="uc1" %>
<%# Register Src="~/Frontend/sublayouts/SearchBox.ascx" TagName="SearchBox" TagPrefix="ZGKSControls" %>
<div class="head">
<div class="line">
<div class="unit sizeCol">
<!-- mod NavService -->
<div class="mod modNavService skinNavServiceHome">
<div class="inner">
<div class="bd">
<ul>
<li>Home</li>
<li><span>
<asp:Literal ID="litWelcome" runat="server"></asp:Literal>
<asp:Literal ID="litUsername" runat="server"></asp:Literal></span></li>
<li class="last"><span>
<asp:Literal ID="litDate" runat="server"></asp:Literal></span></li>
</ul>
</div>
</div>
</div>
<!-- /mod NavService -->
<!-- mod NavService -->
<div class="mod modNavService">
<div class="inner">
<!-- tpl NavService-navservice -->
<div class="bd">
<ul>
<asp:Literal ID="litNaviLinks" runat="server"></asp:Literal>
</ul>
</div>
<!-- /tpl NavService-navservice -->
</div>
</div>
<!-- /mod NavService -->
<!-- mod Favourites -->
<div class="mod modFavourites">
<div class="inner">
<!-- tpl Favourites-favourites -->
<div class="hd">
<ul>
<li>Meine Favoriten
<div class="favnavcontainer">
<div class="wrap">
<div class="list">
<table>
<tbody>
<tr>
<td>
<asp:Label ID="lblFavoritesDescription" runat="server" />
</td>
</tr>
</tbody>
</table>
<table class="highlight">
<tbody>
<asp:Repeater ID="rptFavorite" runat="server" OnItemCommand="RptFavoriteItemCommand">
<ItemTemplate>
<tr class="favoritemark">
<td>
<a href="<%# Eval("Url") %>">
<%# Eval("Title") %></a>
</td>
<td class="delete">
<span>
<asp:ImageButton ToolTip="Löschen" AlternateText="Löschen" ID="btnDeleteFav" runat="server"
CommandName="delFav" CommandArgument='<%# Eval("ID") %>' ImageUrl="~/Frontend/Images/icons/clear.png" />
</span>
</td>
<td class="edit" title="Editieren">
<span></span>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</tbody>
</table>
</div>
</div>
<a class="close" title="" href="#">Schliessen <span>|</span> X</a>
</div>
</li>
<li>Meine Systeme
<div class="favnavcontainer">
<div class="wrap">
<div class="list">
<table>
<tbody>
<tr>
<td>
<asp:Label ID="lblSystemDescription" runat="server" />
</td>
</tr>
</tbody>
</table>
<table class="highlight">
<tbody>
<asp:Repeater ID="rptSysteme" runat="server">
<ItemTemplate>
<tr class="">
<td>
<a target="_blank" href="<%# Eval("Url") %>">
<%# Eval("Title") %></a>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</tbody>
</table>
</div>
</div>
<div class="modContent" style="padding: 0;">
<div style="margin: 10px 0; margin-left: 10px;">
<a target="_self" href='<%# MySystemLink %>' class="icon back" title="Zurück">
<span>Meine Systeme bearbeiten</span>
</a>
</div>
<a class="close" title="" href="#">Schliessen <span>|</span> X</a>
</div>
</div>
</li>
<li>Meine Alerts
<div class="favnavcontainer">
<div class="wrap">
<div class="list">
<table>
<tbody>
<tr>
<td>
<asp:Label ID="lblAlertDescription" runat="server" />
</td>
</tr>
</tbody>
</table>
<table class="highlight">
<tbody>
<asp:Repeater ID="rptAlert" runat="server" OnItemCommand="RptAlertItemCommand">
<ItemTemplate>
<tr class="alertmark">
<td>
<a href="<%# Eval("Url") %>">
<%# Eval("Title") %></a>
</td>
<td class="delete">
<span>
<asp:ImageButton ToolTip="Löschen" AlternateText="Löschen" ID="btnDeleteAlert" runat="server"
CommandName="delAlert" CommandArgument='<%# Eval("ID") %>' ImageUrl="~/Frontend/Images/icons/clear.png" />
</span>
</td>
<td class="edit" title="Editieren">
<span> </span>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</tbody>
</table>
</div>
</div>
<a class="close" title="" href="#">Schliessen <span>|</span> X</a>
</div>
</li>
</ul>
</div>
<div class="bd">
</div>
<!-- /tpl Favourites-favourites -->
</div>
</div>
<!-- /mod Favourites -->
</div>
<div class="unit sizeCol lastUnit">
<div class="line">
<!-- mod Logo -->
<div class="mod modLogo">
<div class="inner">
<!-- tpl Logo-logo -->
<div class="bd">
<a href="/" title="">
<img class="screen" src="/Frontend/Images/logo.gif" width="291" height="27" alt="ZGKS"></a>
</div>
<!-- /tpl Logo-logo -->
</div>
</div>
</div>
<div class="line">
<ZGKSControls:SearchBox ID="SearchBox" runat="server" />
</div>
</div>
<div class="line">
<div class="unit size1of1">
<uc1:NavLayer ID="NavLayer1" runat="server" />
</div>
</div>
</div>
</div>
The issue is due to changes in the webedit.css stylesheet in Sitecore 6.6 from previous versions.
Make sure that /website/webedit.css is present in your inetpub folder, that you do not have it checked into your Visual Studio project, i.e it is not overwriting with a previous version of the file from your source control.

Dropdown menu issue in IPAD browsers

I have an issue in IPAD browsers(Chrome and Safari) like when i click on dropdown menu the values are hiding inside the table section.
Here i am attaching the image .
I have used z-index attribute but still the issue is not fixed.
Here is my code for Table
<div class="table-responsive">
<table class="table table-striped m-b-none text-small b-b" id="eventListTable">
<thead>
<tr>
<th style="width:2% !important;"></th>
<th width="15%"></th>
<th width="10%"></th>
<th width="10%"></th>
<th width="10%"></th>
<th width="10%"></th>
<th width="10%"></th>
<th width="10%"></th>
<th width="10%"></th>
<th width="10%"></th>
<th width="30%"></th>
</tr>
</thead>
<tbody id="tbody">
</tbody>
</table>
</div>
Code for table data <td> and dropdown is inside the table.:
<td> <input type='checkbox' id='eventCheckBox' value=''></td>
<td width="20%" class="wrap-sm"><a class="dropdown-toggle h5"
data-toggle="dropdown" href="#" id="eventName" ></a>
<small class="block"></small>
<h6><span class="label label-info"></span></h6>
</td>
<td width="8%"><h5></h5></td>
<td width="10%"><h5></h5></td>
<td width="9%"><h5></h5></td>
<td width="12%"><h5></h5></td>
<td width="15%"><h5><small class="label bg-light"></small></h5></td>
<td width="15%"><h5><small class="label bg-light"></small></h5></td>
<td width="10%" align="center" style="padding-top:20px">
<i class="icon-circle text-success"></i></td>
<td style="padding-top:20px;">
<div class="btn-group dropup AttendeeDropDown">
<img src="images/icon-add-attendee.png" alt="Add Attendee" class="dropdown-toggle" data-toggle="dropdown" style="cursor:pointer;"/>
<ul class="dropdown-menu" style="margin-left:-122px;">
<li> Create New Attendee</li>
<li>Add Existing Attendee</li>
<li>Import</li>
<li>Export</li>
</ul>
</div>
Code for dropdown inside the table.
<div class="btn-group dropup AttendeeDropDown">
<img src="images/icon-add-attendee.png" alt="Add Attendee" class="dropdown-toggle" data-toggle="dropdown" style="cursor:pointer;"/>
<ul class="dropdown-menu" style="margin-left:-122px;">
<li> Create New Attendee</li>
<li>Add Existing Attendee</li>
<li>Import</li>
<li>Export</li>
</ul>
</div>
I am using bootstrap.css for my application..
How to show the dropdown over the table is it possible with css or using any script?

Rails4 template error in mailer in production

On in my production env. I keep getting this error:
ActionView::Template::Error: undefined method `protocol' for nil:NilClass
I can't figure out where this error are in my template, can anybody help me figure this out?
CODE UPDATE
Complete code: Pastebin
I cut out, the area I think might cause problem:
<tr>
<td class="eHeader" style="">
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="">
<tr>
<td class="eHeader" style="">
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="">
<tr>
<td class="eHeaderLogo" style="">
<a href="#" style="">
<img class="imageFix" src="<%= image_url('crewnetlogo-white.png') %>" width="200" height="48" alt="Crewnet" style="">
</a>
</td>
<!-- end .eHeaderLogo-->
<td class="eHeaderOptions" style="">
</td>
<!-- end .eHeaderOptions-->
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<h1>
<span>
Du er blevet tildelt <%= #workplace.name %>
</span>
</h1>
<div class="bannerLink">
<a href="#" style="">
<img src="<%= image_url "app.png" %>" alt="Crewnet" width="512" height="194" style="">
</a>
</div>
</td>
<!-- end .highlight-->
</tr>
<tr>
<td class="eBody bottomLine" style="">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="entryBox" style="">
<tr>
<td class="width132 pdBt16" style="">
<a href="#" style="">
<img src="<%= image_url "file_icon.gif" %>" width="116" height="116" alt="File" style="">
</a>
</td>
<td class="alignLeft" style="">
<p style="">
Hej <%= #user.name %>!<br>
Du har fået tildelt <%= #workplace.name %> som ansvarsområde. <br>
For mere info log på CrewNet | <%= #workplace.name %>.
</p>
<p style="">
Skulle du have nogle spørgsmål, kan du kontakte supporten på support#crewnet.dk.
<br>
<br>
Teamet bag CrewNet.dk
</p>
</td>
</tr>
</table>
</td>
<!-- end .eBody-->
</tr>
Mailer
class SupervisorMailer < ActionMailer::Base
default from: "support#crewnet.dk"
def assigned(user, workplace)
#user = User.find(user)
#workplace = Workplace.find(workplace)
mail to: #user.email, subject: "Du er ansvarlig for #{#workplace.name}."
end
end
production.rb
config.action_mailer.default_url_options = { :host => Rails.application.secrets.domain_name, :protocol => "http" }
config.action_mailer.asset_host = Rails.application.secrets.domain_name
env
secrets.domain_name = crewnet.dk
Probably it's realted to url building. Do you have asset_host setting in your production.rb? Maybe you have to add protocol to asset_host?
Rails.application.configure do
...
config.action_mailer.asset_host = 'http://example.com'
...
end

jQuery UI Tabs refreshes after button click

I have jQuery UI Tabs page:
<div class="addTheatreContainer">
<div class="addTheatreHeader">
<span class="txtLightboxTitle">ADD THEATRE</span>
</div><!--end/ .addTheatreHeader-->
<!-- Tabs -->
<div id="tabs">
<ul>
<li>
1 B.C.
</li>
<li>
2 Alberta
</li>
</ul>
<div id="#tabs-1">
<table class="table5">
<tr>
<td width="20">
<fieldset class="checkboxes">
<label class="label_check">
<input name="ctl10" type="checkbox" />
</label>
</fieldset>
</td>
<td width="40">ID</td>
<td width="120">Location</td>
<td width="120">Region</td>
<td width="120">City</td>
<td width="70">Province</td>
</tr>
</table>
</div>
<div id="#tabs-2">
<table class="table5">
<tr>
<td width="20"><fieldset class="checkboxes"><label class="label_check"><input name="ctl22" type="checkbox" /></label></fieldset></td>
<td width="40">ID</td>
<td width="120">Location</td>
<td width="120">Region</td>
<td width="120">City</td>
<td width="70">Province</td>
</tr>
</table>
</div>
</div><!--end/ #tabs-->
<div class="ButtonAlignRight">
<button id="btnAddAndCloseTheatre" runat="server" class="btnAddandCloseTheatre" >Add & Close</button>
<button id="btnAddTheatre" runat="server" class="btnAddTheatre" onclick="AddLocations()">Add</button>
<button id="btnClose" runat="server" class="btnClose">Close</button>
</div>
</div>
When I click the Add button. The whole page refreshes and I dont want it to since I am storing values in a global variable.
JS:
function AddLocations()
{
var allChecboxes = $("#tabs").tabs("options", "active").find(".checkboxes");
var allCheckedLocations = allChecboxes.find(".cbLocation").each(function () {
var checkbox = $(this);
if (checkbox.prop("checked") == true)
{
var checkboxId = checkbox.attr("id");
var locationId = parseInt(checkboxId.replace("cbLocation_", ""));
if (typeof (locationId) == "number" && isNaN(locationId) == false) {
AddedLocationsList.push(locationId);
}
//checkbox.parents(".row").fadeOut();
}
});
}
AddedLocationsList is a global variable.This function works perfectly but since the page is refreshed the variable is set back to []. I don't know why the page is being refreshed. Is there a jQuery UI callback?

Resources