Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

closeOnSelect #121

Closed
KevinGF opened this issue Nov 17, 2015 · 7 comments
Closed

closeOnSelect #121

KevinGF opened this issue Nov 17, 2015 · 7 comments

Comments

@KevinGF
Copy link

KevinGF commented Nov 17, 2015

When I set closeOnSelect to true, meet error "TypeError: Cannot call method 'close' of undefined"

@KevinGF KevinGF closed this as completed Nov 17, 2015
@KevinGF KevinGF reopened this Nov 17, 2015
@jase88
Copy link

jase88 commented Nov 17, 2015

@KevinGF
Copy link
Author

KevinGF commented Nov 17, 2015

@kerosin I am using popup. But, when use modal, the follow error will occur :

TypeError: Cannot call method 'hide' of undefined
at n.modal.a.templateType.toLowerCase.a.closeModal

@jase88
Copy link

jase88 commented Nov 17, 2015

Can you provide your code somewhere? (e.g. codepen)

@bivainis
Copy link

Getting the same error using popup with closeOnSelect enabled. For whatever reason popup is undefined here https://github.com/rajeshwarpatlolla/ionic-datepicker/blob/master/src/ionic-datepicker.directive.js#L320

@KevinGF
Copy link
Author

KevinGF commented Nov 27, 2015

@kerosin , please refer to following code

var datePickerCallback = function (val) {
      if (typeof(val) === 'undefined') {
        console.log('No date selected');
      } else {
        $scope.testDate = $filter('date')(val,'yyyy-MM-dd');
        console.log('Selected date is : ', $scope.testDate);
      }
    };
var weekDaysList = ["日", "一", "二", "三", "四", "五", "六"];
var monthList = ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"];
var disabledDates = [];
$scope.datepickerObject = {
          titleLabel: '购买日期',  //Optional
          todayLabel: '当前',  //Optional
          closeLabel: '关闭',  //Optional
          setLabel: '确定',  //Optional
          setButtonType : 'button-positive',  //Optional
          todayButtonType : 'button-assertive',  //Optional
          closeButtonType : 'button-stable',  //Optional
          inputDate: new Date(),  //Optional
          mondayFirst: true,  //Optional
          disabledDates: disabledDates, //Optional
          weekDaysList: weekDaysList, //Optional
          monthList: monthList, //Optional
          templateType: 'popup', //Optional, 'popup' or 'modal'
          showTodayButton: 'false', //Optional
          modalHeaderColor: 'bar-positive', //Optional
          modalFooterColor: 'bar-positive', //Optional
          callback: function (val) {  //Mandatory
            datePickerCallback(val);
          },
          dateFormat: 'yyyy-MM-dd', //Optional
          closeOnSelect: true, //Optional
};

@b3na
Copy link

b3na commented Nov 27, 2015

On popup the date changes on select, but the popup doesn't close and if i choose modal, the modal appears and closes immediately staying on the same date.

@rajeshwarpatlolla
Copy link
Owner

Same as #112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants