laravel php bootstrap nested tabs not workinfg - php

I´m having trouble with dynamic tabs, php code works fine. The problem is with bootstrap tabs.
Already tried updating bootstrap files and it did't work!
<ul class="nav nav-tabs nav-justified tabprofile" id="outerTab" role="tablist">
#foreach($parentCategories as $count => $category)
<li class="nav-item">
<a
#if($count == 0) class="nav-link fade show active " #else class="nav-link checklist" #endif
id="{{$category->id}}-tab" data-toggle="tab" href="#{{$category->id}}"
role="tab" aria-controls="{{$category->id}}" #if($count == 0) aria-selected="true" #else aria-selected="false" #endif>{{$category->name}}</a>
</li>
#endforeach
</ul>
<div class="tab-content">
#foreach($parentCategories as $count => $category)
<div #if($count == 0) class="tab-pane fade show active" #else class="tab-pane checklist" #endif id="{{$category->id}}" role="tabpanel" aria-labelledby="{{$category->id}}-tab" >
<ul class="nav nav-tabs nav-justified" id="innerTab" role="tablist">
#foreach($category->children as $count => $sub)
<li class="nav-item">
<a class="nav-link #if($count == 0) show active #endif" id="{{$sub->id}}-tab" data-toggle="tab" href="#{{$sub->id}}"
role="tab" aria-controls="{{$sub->id}}" #if($count == 0) aria-selected="true" #else aria-selected="false" #endif>{{$sub->slug}}</a>
</li>
#endforeach
</ul>
<div class="tab-content">
#foreach($category->children as $count => $sub)
<div #if($count == 0) class="tab-pane fade show active checklist" #else class="tab-pane checklist" #endif id="{{$sub->id}}" role="tabpanel" aria-labelledby="{{$sub->id}}-tab" >
<table class="table table-bordered">
<tbody>
#foreach($checklist->objectives->where('category_id', $sub->id) as $objective)
<tr>
<th>
{{$objective->competence}} - {{$objective->title}}
</th>
<td>
#switch($objective->pivot->status)
#case('Consistente')
<span class="badge badge-success">{{$objective->pivot->status}}</span>
#break
#case('Difícil de obter')
<span class="badge badge-danger">{{$objective->pivot->status}}</span>
#break
#case('Mais ou Menos')
<span class="badge badge-warning">{{$objective->pivot->status}}</span>
#break
#default
<span class="badge badge-secondary">{{$objective->pivot->status}}</span>
#break
#endswitch
</td>
</tr>
#endforeach
</tbody>
</table>
</div><!-- level content -->
#endforeach
</div><!-- tab-content -->
</div><!-- level content -->
#endforeach
I have tried mostly everything and it does not work.
Hope anyone can help me.. Thanks

Related

pass variable through blade pagination

I need to use pagination on a laravel blade, but from the controller comes another variable that does not pass pagination, how can I solve it?
<div class="main-content">
<div class="breadcrumb">
<h1>Página de Cliente</h1>
</div>
<div class="separator-breadcrumb border-top"></div>
<div class="card user-profile o-hidden mb-4">
<div class="user-info"><img class="profile-picture avatar-lg mb-2" alt="" />
<p class="m-0 text-24">{{ $customer->name }}</p>
<p class="text-muted m-0">{{ $customer->email }}</p>
</div>
<div class="card-body">
<ul class="nav nav-tabs profile-nav mb-4" id="profileTab" role="tablist">
<li class="nav-item"><a class="nav-link active" id="timeline-tab" data-toggle="tab" href="#timeline" role="tab" aria-controls="timeline" aria-selected="false">Propostas</a></li>
<li class="nav-item"><a class="nav-link" id="about-tab" data-toggle="tab" href="#about" role="tab" aria-controls="about" aria-selected="true">#</a></li>
<li class="nav-item"><a class="nav-link" id="friends-tab" data-toggle="tab" href="#friends" role="tab" aria-controls="friends" aria-selected="false">#</a></li>
<li class="nav-item"><a class="nav-link" id="photos-tab" data-toggle="tab" href="#photos" role="tab" aria-controls="photos" aria-selected="false">#</a></li>
</ul>
<div class="tab-content" id="profileTabContent">
<div class="tab-pane fade active show" id="timeline" role="tabpanel" aria-labelledby="timeline-tab">
<div class="row mb-4">
<div class="col-md-12 mb-3">
<div class="card text-left">
<div class="card-body">
<h4 class="card-title mb-3">Lista de Propostas</h4>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Data</th>
<th scope="col">Vendedor</th>
<th scope="col">Produto</th>
<th scope="col">Preço</th>
<th scope="col">Produção</th>
</tr>
</thead>
#foreach($proposals as $proposal)
<tbody>
<tr>
<th scope="row"> {{ $proposal->id_proposal }} </th>
<td> {{ $proposal->date }} </td>
<td> {{$proposal->users()->first()->name }} </td>
<td>
#foreach($proposal->proposed_phases()->get() as $proposedphase)
<p>{{ $proposedphase->features()->first()->name }}</p>
#endforeach
</td>
<td>
#foreach($proposal->proposed_phases()->get() as $proposedphase)
<p>{{ $proposedphase->amount }}€</p>
#endforeach
</td>
#if($proposal->id_production == null)
<td><span class="badge badge-danger">Produção</span></td>
#else
<td><span class="badge badge-success">Produção</span></td>
#endif
#if($proposal->id_production == null)
<td>
<a href="{{ URL::route('new.production', array('id_proposal'=>$proposal->id_proposal)) }}" class="text-success mr-2">
<button class="nav-icon i-Add font-weight-bold btn btn-success m-0" type="button" data-toggle="tooltip" data-placement="top" title="Criar Produção"></button>
</a>
</td>
#else
<td>
<a href="{{ URL::route('new.label', array('id_proposal'=>$proposal->id_proposal)) }}" class="text-success mr-2">
<button class="nav-icon i-Add font-weight-bold btn btn-warning m-0" type="button" data-toggle="tooltip" data-placement="top" title="Criar Etiquetas"></button>
</a>
</td>
#endif
</tr>
</tbody>
#endforeach
</table>
{{-- Pagination --}}
<div class="d-flex justify-content-center">
{!! $proposals->links() !!}
</div>
</div>
</div>
</div>
</div>
CONTROLLER
public function PageCustomer(Request $request)
{
$data = $request->all();
$customer = customer::where('id_customer', $data['id_customer'])->first();
$proposals = proposal::where('id_customer', $customer['id_customer'])->paginate(5);
return view('admin.customer.page_customer', compact('customer', 'proposals'));
}
the variable that does not pass to the second page is $customer
I tried to pass an array with the values ​​of name and email, but it didn't work. how can i resolve this situation?
Use appends on Paginator :
{!! $proposals->appends(['customer' => $customer])->links() !!}
As of Laravel 7, you can call the withQueryString() method on your Paginator instance :
{!! $proposals->withQueryString()->links() !!}
withQueryString() method appends all current query string values to the pagination links.

Why is appering a pagination error after click in the search button?

I have a page "https://proj.test/user/profile?user=2#myRegistrations" where I have two tabs, one tab show the past registrations of a user in conferences and other tab the next registrations of the user in a conference. The user can click "Past Registrations" to check the past registrations and click in "Next Registrations" to check his next registrations in conferences. And its working.
In this same page, above the tabs, I have a form for the user to search for a conference name where he his registered. But when the user enters some text in the form search input like "test" and click in "Search" it appears "Undefined property: Illuminate\Pagination\LengthAwarePaginator::$participants (View: /Users/john/projects/proj/resources/views/users/index.blade.php)". Do you know what can be the issue?
Code in he view:
<div class="tab-pane clearfix fade" id="myTickets" role="tabpanel" aria-labelledby="contact-tab">
<div class="d-flex justify-content-between">
<form method="get" class="clearfix w-75" method="POST" action="{{ route('user.searchRegistration') }}">
{{ csrf_field() }}
<div class="form-group col col-md-6 px-0">
<div class="input-group" data-provide="datepicker">
<input type='text' class="form-control" placeholder="Search Registrations"
name="search_registration"
value="{{old('search_registration')}}"/>
<button class="input-group-addon">Search</button>
</div>
</div>
</form>
<a href="{{route('user.cleanSearchRegistration')}}" class="btn btn-outline-primary"
id="cleanSearchRegistration">Clean Search</a>
</div>
#if(session('searchedRegistrations'))
#if(session('searchedRegistrations')->count() != null)
#foreach(session('searchedRegistrations') as $registration)
#foreach(session('searchedRegistrations')->participants as $participant)
#if(!empty($registration))
<li class="list-group-item">
<h5>{{optional($registration->conference)->name}}</h5>
#if ($registration->status == 'C')
<a href="{{route('conference.registrationInfo',
['id' => $registration->conference->id,
'slug' => $registration->conference->slug,
'regID'=> $registration->id])}}"
class="btn btn-primary ml-2"><i class="fa fa-file-pdf-o"></i> Registration document
</a>
#endif
#if ($participant->registration_type->certificate_available == 'Y')
<a href="{{route('conferences.certificateInfo',
[
'regID'=> $registration->id])}}"
class="btn btn-primary ml-2"><i class="fa fa-file-pdf-o"></i> Download certificate
</a>
#break
#endif
</li>
#endif
#endforeach
#endforeach
<div class="text-center d-flex justify-content-center mt-3">
{{session('searchedRegistrations')->fragment('searchRegistrations')->links("pagination::bootstrap-4")}}
</div>
#else
<div class="alert alert-info" role="alert">
<i class="material-icons">info</i>
<span>Your search didnt return any result.</span>
</div>
#endif
#else
<div class="d-flex mb-3">
<ul class="nav nav-pills">
<li class="nav-item">
<a class="nav-link active border" href="#nextConferences" data-toggle="tab" role="tab">Next
Conferences</a>
</li>
<li class="nav-item">
<a class="nav-link border" href="#PastRegistrations" data-toggle="tab" role="tab">Past
Conferences</a>
</li>
</ul>
</div>
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active clearfix" id="nextConferences" role="tabpanel"
aria-labelledby="home-tab">
<ul class="list-group">
#foreach($nextRegistrations as $nextRegistration)
#foreach($nextRegistration->participants as $participant)
#if(!empty($nextRegistration->conference) || !empty($nextRegistration->conference->start_date))
<li class="list-group-item">
<h5>{{optional($nextRegistration->conference)->name}}</h5>
#if ($participant->registration_type->certificate_available == 'Y')
<a href="{{route('conferences.certificateInfo',
[
'regID'=> $nextRegistration->id])}}"
class="btn btn-primary ml-2"><i
class="fa fa-file-pdf-o"></i> Download Certificate</a>
#break
#endif
#if ($nextRegistration->status == 'C')
<a href="{{route('conferences.registrationInfo',
[
'regID'=> $nextRegistration->id])}}"
class="btn btn-primary ml-2"><i
class="fa fa-file-pdf-o"></i> Registration document
</a>
#endif
</li>
#endif
#endforeach
#endforeach
</ul>
<div class="text-center d-flex justify-content-center mt-3">
{{$nextRegistrations->fragment('nextConferences')->links("pagination::bootstrap-4")}}
</div>
</div>
<div class="tab-pane fade show clearfix" id="pastConferences" role="tabpanel" aria-labelledby="home-tab">
<ul class="list-group">
#foreach($pastRegistrations as $pastRegistration)
#foreach($pastRegistration->participants as $participant)
#if(!empty($pastRegistration->conference) || !empty($pastRegistration->conference->start_date))
<li class="list-group-item">
<h5>{{optional($pastRegistration->conference)->name}}</h5>
#if ($participant->registration_type->certificate_available == 'Y')
<a href="{{route('conferences.certificateInfo',['regID'=> $pastRegistration->id])}}"
class="btn btn-primary ml-2"><i
class="fa fa-file-pdf-o"></i> Download Certificate
</a>
#break
#endif
#if ($pastRegistration->status == 'C')
<a href="{{route('conferences.registrationInfo',
[
'regID'=> $pastRegistration->id])}}"
class="btn btn-primary ml-2"><i
class="fa fa-file-pdf-o"></i> Registration info
</a>
#endif
</li>
#endif
#endforeach
#endforeach
</ul>
<div class="text-center d-flex justify-content-center mt-3">
{{$pastRegistrations->fragment('pastConferences')->links("pagination::bootstrap-4")}}
</div>
</div>
</div>
</div>
I assume session('searchedRegistrations') is the Pagination instance. There is no property named participants nor would there be any random properties (it is a container, not what it contains). I would imagine a model instance contained in the collection might have a participants property though.
#foreach(session('searchedRegistrations') as $registration)
#foreach(session('searchedRegistrations')->participants as $participant)
I am guessing that should be
#foreach($registration->participants as $participant)

Displays categories and sub categories (Laravel Blade)

i have problem with display category and subcategories , i made this
in my blade
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><b class="fa fa-home"></b> Начало</li>
#foreach ($categories as $cat)
#foreach($subcategories as $sub)
#if($sub->parent_id == $cat->id)
<li class="dropdown ">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
{{$cat->name}} <i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu">
<li>{{ $sub->name }}</li>
</ul>
</li>
#endif
#endforeach
#endforeach
</ul>
</div>
</div>
</nav>
It show categories only when have one subcategory, i don't know why happend! Someone help me! (No bad votes please)
Here is my variables:
$categories = Category::where('parent_id', NULL)->get();
$subcategories = Category::where('parent_id','!=',NULL)->get();
The issue here is that you only create the list item within your foreach loop when there is a sub category aswell.
This example should do the trick for you.
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><b class="fa fa-home"></b> Начало</li>
#foreach ($categories as $cat)
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
{{$cat->name}} <i class="fa fa-caret-down"></i>
</a>
#foreach($subcategories as $sub)
#if($sub->parent_id == $cat->id)
<ul class="dropdown-menu">
<li>{{ $sub->name }}</li>
</ul>
#endif
#endforeach
</li>
#endforeach
</ul>
</div>
It is untested so let me know if it doesn't work.
I fixed it with little changes, but now work thanks #answered26
Here is my changes
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><b class="fa fa-home"></b> Начало</li>
#foreach ($categories as $cat)
<li class="{{ $cat->children->count() > 0 ? 'dropdown' : ''}}">
<a href="#" class="{{ $cat->children->count() > 0 ? 'dropdown-toggle' : '' }}" data-toggle="dropdown">
{{$cat->name}} {!! $cat->children->count() > 0 ? '<b class="fa fa-caret-down"></b>' : '' !!}
</a>
<ul class="dropdown-menu">
#foreach($subcategories as $sub)
#if($sub->parent_id == $cat->id)
<li>{{ $sub->name }}</li>
#endif
#endforeach
</ul>
</li>
#endforeach
</ul>
</div>
</div>

How to show/hide fields on link click?

I am using laravel 5.3
I have a responding navigation menu, when I click on domains, it shows all the domains I already have in DB, and then when I click on one of these domains I get the corresponding projects.
Now, I am want that when I click on project it displays all the corresponding data in a table for example. But, this is what I am getting :
this is ProjectController :
public function index(Request $request)
{
$projects1=DB::table('projects')->where('domain_id', '=', 1)->get();
$projects2=DB::table('projects')->where('domain_id', '=', 2)->get();
$projects3=DB::table('projects')->where('domain_id', '=', 3)->get();
return view('projects.index',compact('projects', 'projects1', 'projects2', 'projects3'));
}
and this is index.blade.php :
<div class="nav-side-menu">
<div class="brand">Menu</div>
<i class="fa fa-bars fa-2x toggle-btn" data-toggle="collapse" data-target="#menu-content"></i>
<div class="menu-list">
<ul id="menu-content" class="menu-content collapse out">
<li data-toggle="collapse" data-target="#products" class="collapsed active">
<i class="fa fa-gift fa-lg"></i> Domains <span class="arrow"></span>
</li>
<ul class="sub-menu collapse" id="products">
<li data-toggle="collapse" data-target="#domain1_projet" class="collapsed active">
<i class="fa fa-gift fa-lg"></i> Domain 1 <span class="arrow"></span>
</li>
<ul class="sub-menu collapse" id="domain1_projet">
#foreach ($projects1 as $key => $project)
<li>{{$project->title}}</li>
#endforeach
<table class="table table-bordered">
<tr>
<th>No</th>
<th>title</th>
<th>code</th>
<th>domain_id</th>
</tr>
#foreach ($projects1 as $key => $project1)
<tr>
<td>{{ ++$i }}</td>
<td>{{ $project1->title }}</td>
<td>{{ $project1->code }}</td>
<td>{{ $project1->domain_id}}</td>
</tr>
#endforeach
</table>
</ul>
<li data-toggle="collapse" data-target="#domain2_projet" class="collapsed active">
<i class="fa fa-gift fa-lg"></i> Domain 2 <span class="arrow"></span>
</li>
<ul class="sub-menu collapse" id="domaine2_projet">
#foreach ($projects2 as $key => $project)
<li>{{$project->title}}</li>
#endforeach
</ul>
</ul>
</ul>
</div>
</div>
the #if clause I added before table was just to test, but I need to change that. I want to be able to display data of each project not in a manual way. I also want to know how to show and hide the information of each project when clicking on the links.
As you can see in index.blade.php, It's because I already know the names of project I did if (($project->intitule)=="Title") and elseif(($project->intitule)=="Project2") But, in fact I have many projects in database. How can I be able to display all the projects and then when I click on one of them, how can get a table containing information of that specific project
CONTROLLER
public function index(Request $request)
{
$projects=DB::table('projects')->get();
return view('projects.index',compact('projects'));
}
VIEW
<div class="nav-side-menu">
<div class="brand">Menu</div>
<i class="fa fa-bars fa-2x toggle-btn" data-toggle="collapse" data-target="#menu-content"></i>
<div class="menu-list">
<ul id="menu-content" class="menu-content collapse out">
<li data-toggle="collapse" data-target="#products" class="collapsed active">
<i class="fa fa-gift fa-lg"></i> Domains <span class="arrow"></span>
</li>
<ul class="sub-menu collapse" id="products">
#for ($i = 0; $i < count($projects); $i++)
<li data-toggle="collapse" data-target="#domain1_projet{{$i}}" class="collapsed active">
<i class="fa fa-gift fa-lg"></i> Domain {{$projects[$i]->domain_id}} <span class="arrow"></span>
</li>
<ul class="sub-menu collapse" id="domain1_projet{{$i}}">
<li>{{$projects[$i]->title}}</li>
<table class="table table-bordered">
<tr>
<th>No</th>
<th>title</th>
<th>code</th>
<th>domain_id</th>
</tr>
<tr>
<td>{{ $i }}</td>
<td>{{ $projects[$i]->title }}</td>
<td>{{ $projects[$i]->code }}</td>
<td>{{ $projects[$i]->domain_id}}</td>
</tr>
</table>
</ul>
#endfor
</ul>
</ul>
</div>
</div>
Try it! and let me know if return errors!

Two ids on the same tbody

I'm trying to display some results on a table based on few dropdown which is used for displaying different results, I choose the parameter followed the date. Unfortunately if I'm not mistaken it is illegal to have two ids on a tbody, as seen my code only takes into consideration of the date and not the parameter selected, so is there any alternative solution to what I'm trying to do?
#extends('app')
#section('header')
<link href="css/reports.css" rel="stylesheet">
#stop
#section('content')
<h1 class="page-header">Reports Archive</h1>
<div class="dropdown">
<a style="font-weight:bold" id="drop5" href="#" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" role="button" aria-expanded="false">
Zone Options:
<span class="caret"></span>
</a>
<ul id="menu2" class="dropdown-menu" role="menu" aria-labelledby="drop5">
<?php $count = 1; ?>
#foreach ($zones as $zone)
<li role="presentation" class="{{ $count == 0 ? 'active' : '' }}">
<a role="menuitem" tabindex="-1" href="#" data-target="#zone{{ $zone->id }}"> {{ $zone->zone_name }}</a></li>
<?php $count++; ?>
#endforeach
</ul>
</div>
<div role="tabpanel">
<!-- hide the below links-->
<ul class="nav nav-tabs" style="display:none;" role="tablist" id="myTab">
<?php $count = 1; ?>
#foreach ($zones as $zone)
<li role="presentation" class="{{ $count == 0 ? 'active' : '' }}">{{ $zone->zone_name }}</li>
<?php $count++; ?>
#endforeach
</ul>
<!-- Tab panes -->
<div class="tab-content">
<?php $count = 1; ?>
#foreach ($zones as $zone)
<div role="tabpanel" class="tab-pane fade in {{ $count == 0 ? 'active' : '' }}" id="zone{{ $zone->id }}">
<div class="col-md-12">
<h2> {{ $zone->zone_name }} </h2>
<table class="table table-responsive table-hover table-bordered">
<thead>
<tr>
<th style="vertical-align:middle">#</th>
<th>
<div class="dropdown">
<a style="font-weight:bold" id="drop5" href="#" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" role="button" aria-expanded="false">
Parameter Name:
<span class="caret"></span>
</a>
<ul id="menu2" class="dropdown-menu" role="menu" aria-labelledby="drop5">
#foreach ($zone->parameter as $param)
<li role="presentation">
<a class="btn btn-link" data-collapse-group="filters" data-target="#{{ $param->id }}" data-toggle="collapse">{{ $param->parameter_name }}</a></li>
#endforeach
</ul>
</div>
</th>
<th style="vertical-align:middle">Reading Value</th>
<th style="vertical-align:middle">User</th>
<th style="vertical-align:middle">Status</th>
<th style="vertical-align:middle">
<div class="dropdown" style="position:relative">
<a style="font-weight:bold" href="#" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Timestamp
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<?php $validate = "default" ?>
<?php $records = App\Reading::sort()->get() ?>
#foreach ($records as $record)
#if ($record->created_at->year != $validate)
<li>
<a class="trigger right-caret">
{{ $record->created_at->year }}
</a>
<ul class="dropdown-menu sub-menu">
<li>January</li>
<li>February</li>
<li>March</li>
<li>April</li>
<li>May</li>
<li>June</li>
<li>July</li>
<li>August</li>
<li>September</li>
<li>October</li>
<li>November</li>
<li>December</li>
</ul>
</li>
<?php $validate = $record->created_at->year ?>
#endif
#endforeach
</ul>
</div>
</th>
</tr>
</thead>
<?php $validate = "default" ?>
#foreach ($records as $record)
#if ($record->created_at->year != $validate)
<?php $month = 1; ?>
#while ($month != 13)
#foreach ($parameters as $param)
<?php $index = 1; ?>
#if ($param->zone_id == $zone->id)
<tbody id="{{ $record->created_at->year }}-{{ $month }}" class="collapse">
#foreach ($readings as $reading)
#if ($reading->parameter_id == $param->id)
#if ($reading->created_at->year == $record->created_at->year)
#if ($reading->created_at->month == $month)
<tr>
<td>{{ $index }}</td>
<td>{{ $reading->parameter->parameter_name }} </td>
<td>{{ $reading->reading_value }} </td>
<td>{{ $reading->user->name }} </td>
<td>{{ $reading->parameter->threshold->getStatus($reading->reading_value) }} </td>
<td>{{ $reading->created_at }} </td>
</tr>
<?php $index++; ?>
#endif
#endif
#endif
#endforeach
#endif
</tbody>
</div>
#endforeach
<?php $month++; ?>
#endwhile
<?php $validate = $record->created_at->year ?>
#endif
#endforeach
</div>
</table>
</div>
</div>
<?php $count++; ?>
#endforeach
</div>
</div>
#stop
#section('scripts')
<script>
$(function(){
$(".dropdown-menu > li > a.trigger").on("click",function(e){
var current=$(this).next();
var grandparent=$(this).parent().parent();
if($(this).hasClass('left-caret')||$(this).hasClass('right-caret'))
$(this).toggleClass('right-caret left-caret');
grandparent.find('.left-caret').not(this).toggleClass('right-caret left-caret');
grandparent.find(".sub-menu:visible").not(current).hide();
current.toggle();
e.stopPropagation();
});
$(".dropdown-menu > li > a:not(.trigger)").on("click",function(){
var root=$(this).closest('.dropdown');
root.find('.left-caret').toggleClass('right-caret left-caret');
root.find('.sub-menu:visible').hide();
});
});
</script>
#stop
It is illegal to have two ids on the same HTML element, as in this example
<div id="id1" id="id2"> <!-- Here be dragons -->
You can skirt this by just having a delimeter in a single id:
<div id="id1--id2">
Or, you can use arbitrary data attributes:
<div id="" data-date="2015-10-14" data-parameter="zone_id">
Since you're using jQuery, here is a question that specifically asks about how to retrieve a data attribute.

Categories