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

Call a method on Next and Previous icon click #40

Open
nishadotcom opened this issue Jan 14, 2016 · 9 comments
Open

Call a method on Next and Previous icon click #40

nishadotcom opened this issue Jan 14, 2016 · 9 comments

Comments

@nishadotcom
Copy link

Hai @twinssbc

I like to call a method on Previous and Next icon click.

E.g:

I have a controller in body tag. Name is my_controller.

I have declared a method here.

I like to call the method while click on the Next or previous icon.

Please suggest.

Best
nishadotcom

@twinssbc
Copy link
Owner

@nishadotcom There's a rangeChanged callback you can use, please kindly check the README for the detail. Let me know if it can meet your requirement. Thanks.

@nishadotcom
Copy link
Author

Hai @twinssbc

Thanks for the instruction, I wrote a separate method called Test() but I could not access it and I did not get the result.( The result would be simple alert)

Please suggest.

Best
nishadotcom

@twinssbc
Copy link
Owner

@nishadotcom could you provide your related html and js files so that I can have a look?

@nishadotcom
Copy link
Author

Hai @twinssbc

Sure.

Controller
angular.controller('myController', function ($scope) {
$scope.get_date = function (date_param) {
alert(date_param);
};
});

I need to alert the date when I click on Next or Previous button by clicking.

Best
nishadotcom

@twinssbc
Copy link
Owner

@nishadotcom How do you use your get_date function in html file?

@nishadotcom
Copy link
Author

Hai @twinssbc

I need to call it on ng-click.

@twinssbc
Copy link
Owner

@nishadotcom I still don't know where do you call this get_date function.
In calendar.html, the ng-click is already bound to move function, did you replace it using your get_date function?
Is it possible your get_date function is defined in another scope that can't be reached to?

<div class="nav-right col-xs-2">
            <button type="button" class="btn btn-default btn-sm" ng-click="move(1)"><i
                    class="glyphicon glyphicon-chevron-right"></i></button>
</div>

@nishadotcom
Copy link
Author

Hai @twinssbc

I call the method as semicolon separated

Yes, It is not reaching out. So I am getting your input.

The thing is I need to get data from service for the particular month.

Best
nishadotcom

@twinssbc
Copy link
Owner

@nishadotcom Instead of customizing the calendar internal behaviour, why not using the callback the calendar exposes?

rangeChanged
The callback function triggered when the range or mode is changed if the queryMode is set to 'remote'

$scope.rangeChanged = function (startTime, endTime) {
    Events.query({startTime: startTime, endTime: endTime}, function(events){
        $scope.eventSource=events;
    });
};

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

2 participants