Skip to content Skip to sidebar Skip to footer

JQuery: Result Of Script Gets Deleted After Execution - RemoveData() Running On The Background?

I have a modal window used to update or add a new object Store. This modal has a cascading dropdownlist for two properties: Department and District. How should it work: We first id

Solution 1:

The idea is to take manual control of the loading and inserting of the remote content received from /Stores/Create. I'm not set up to test this but give it a try.

You will need to get rid of/comment out the existing .on('showN.bs.modal') handler, and you might have to get rid of the href on the <a> tag that invokes the modal, not sure.

$('#modal-action-store').on('show.bs.modal', function (e) {
    if (wasclicked == 1) {
        // load the form, once it's done loading modify it as needed
        $('#modal-action-store').find('.modal-content').load('/Stores/Create', function () {
            $('#DistrictID').html('<option value='0'>-- Seleccione Distrito --</option>');
        });
    }
});

Post a Comment for "JQuery: Result Of Script Gets Deleted After Execution - RemoveData() Running On The Background?"