Mawg
Mawg

Reputation: 40150

AngularJs popup datepicker won't open

My code is too large to post here, so I just post the relevant parts.

I have a fairly large app and now I want to add a datapicker. I copied the code from the Angular UI bootstrap site.

In my controller I initialize

$scope.popup1 ={'opened': false}
$scope.dt = new Date();

and declare

$scope.open1 = function()
{
    $scope.popup1.opened=true;
}

and, in my view I have

<input type="text" class="form-control" uib-datepicker-popup="{{format}}" ng-model="dt"   
   is-open="popup1.opened" min-date="minDate" max-date="maxDate"  
   datepicker-options="dateOptions" date-disabled="disabled(date, mode)"  
   ng-required="true" close-text="Close"   
   alt-input-formats="altInputFormats" />
<span class="input-group-btn">
   <button type="button" class="btn btn-default" ng-click="open1()">  
      <i class="glyphicon glyphicon-calendar"></i></button>
</span>

when I click the button, the function is called and $scope.popup1.opened is set to true.

However, the datepicker does not pop up.

Am I missing something obvious? Do I need to enable the datepicker or something?

Upvotes: 0

Views: 637

Answers (1)

ogugger
ogugger

Reputation: 122

I had a similar problem once that a calendar popup didn't show up. It turned out to just be a CSS problem, it was hidden behind another object. See if you can find the popup anywhere in the DOM and then check what it's z-index CSS property is set to.

Upvotes: 1

Related Questions