Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "joe704la"

if I put the code below directly in the console, after the modal is open then it works. Does that give you any ideas of where I should be putting that?

jQuery('.date-picker').datepicker({
    orientation: "left",
    autoclose: true
});

Unfortatntly I wouldn't be able to email it. It is around 450MB. What are you thinking could possibly be wrong?

I was able to get Datepicker to work just fine in a normal view but not Modal.

The code you wanted me to try

modal.on('shown.bs.modal', function () {
    modal.find('.date-picker').datepicker({
        orientation: "left",
        autoclose: true
    });
});

Doesn't work because I open the modal differently. Below shows an example how I do it. How exactly would I be able to do something similar to what you suggested in the below method of opening a modal?

function openCreateOrEditPetModal(renterId, petId) {
                var modalInstance = $uibModal.open({
                    templateUrl: '~/App/common/views/renters/createOrEditPetModal.cshtml',
                    controller: 'common.views.renters.createOrEditPetModal as vm',
                    backdrop: 'static',
                    resolve: {
                        renterId: function () {
                            return renterId;
                        },
                        petId: function () {
                            return petId;
                        }
                       
                    }

                });


                modalInstance.result.then(function (result) {
                    init();
                });
            }

That makes sense. Thank you, that actually gives me an idea.

Thank you.

One more question. Do you know how to format the date on the model binding? In my text box when editing a date it shows it in the following format. 2016-10-19T00:00:00Z. I want it to show as 10/19/2016 instead. I know how to do it in a view such as {{vm.renter.dob | date:"MM/dd/yyyy"}} but I cannot do it that way in the text box.

I don't know Angular very well but I found an example online of someone creating a directive to handle this, below is the code for the directive. It actually works and puts it in the format I want it in, but for some reason it takes one day off of the date no matter what date I set. So for example if I set the date to 1/24/2016, after I reload the view it will say 1/23/2016. But the super weird thing is in the database it will be the correct date.

appModule.directive('date', function (dateFilter) {
    return {
        require: 'ngModel',
        link: function (scope, elm, attrs, ctrl) {

            var dateFormat = attrs['date'] || 'MM/dd/yyyy';

            ctrl.$formatters.unshift(function (modelValue) {
                return dateFilter(modelValue, dateFormat);
            });
        }
    };
});

Does that go in the Modal controller? or would it go in the function that opens the modal?

I am having issues getting the datepicker from the Metronic theme working.

I added my scripts to the ScriptPaths.cs file and styles to StylePaths.cs file. And also the AppBundleConfig.cs file.

Then in my modal controller where I want to use the date picker I added the below function. Then call that function in the init() method of the modal controller.

var ComponentDateTimePickers = function () {
    var handleDatePickers = function () {

        if (jQuery().datepicker) {
            $('.date-picker').datepicker({
                orientation: "left",
                autoclose: true
            });
        }
    }

    return {
        //main function to initiate the module
        init: function () {
            handleDatePickers();
        }
    };
}();

Oh and also I did try the date range picker singular version which did work but I didn't like how I couldn't choose a different year without having to scroll to the date. This is a date of birth field so for some people having to scroll through 30 or so years is horrible design.

Oh yes that makes complete sense. One of those duh moments. Thank you

I have no problem with ng-repeat. I just am such a newbie to Angular I don't really know all the ways to use it. Also I am not sure how to submit the collection with the rest of the form into my service endpoint. Any pointers on that?

I have a form I want to be able to add additional collections to as the user wants. For example, say they want to enter they have a pet with the pet details. They want to add another pet, and then another etc.

Similar to this <a class="postlink" href="https://blog.rsuter.com/asp-net-mvc-how-to-implement-an-edit-form-for-an-entity-with-a-sortable-child-collection/">https://blog.rsuter.com/asp-net-mvc-how ... ollection/</a>

But in a Angular way and that works with Metronic. Do you guys have any idea how I could accomplish something similar to that?

Showing 171 to 180 of 246 entries