Click here to Skip to main content
14,635,443 members
Home » Discussions » JavaScript
   

JavaScript

 
GeneralRe: How to use Open Street map or any other Map Offline with web application Pin
Member 1451287515-Apr-20 2:32
MemberMember 1451287515-Apr-20 2:32 
GeneralRe: How to use Open Street map or any other Map Offline with web application Pin
Richard MacCutchan15-Apr-20 2:40
mveRichard MacCutchan15-Apr-20 2:40 
GeneralRe: How to use Open Street map or any other Map Offline with web application Pin
Member 1451287515-Apr-20 2:48
MemberMember 1451287515-Apr-20 2:48 
QuestionRe: How to use Open Street map or any other Map Offline with web application Pin
Richard MacCutchan15-Apr-20 3:06
mveRichard MacCutchan15-Apr-20 3:06 
QuestionHow to read Doc or Pdf file using javascript or jquery Pin
Member 1261817013-Apr-20 23:05
MemberMember 1261817013-Apr-20 23:05 
QuestionRead email from outlook and display on website javascripts Pin
Member 147950937-Apr-20 3:31
MemberMember 147950937-Apr-20 3:31 
AnswerRe: Read email from outlook and display on website javascripts Pin
Richard Deeming7-Apr-20 3:45
mveRichard Deeming7-Apr-20 3:45 
Question./watch is compiling the JS library files mostly but one file it is always caching Pin
simpledeveloper11-Mar-20 6:51
Membersimpledeveloper11-Mar-20 6:51 
Hi All I am using Ember even though I am making changes but when I run the ./watch its not producing the JavaScript file with new code - its annoying - I am making the manual change but that's not correct solution right? I made the change to the file even by opening in folder and manually updated the code on ember file - still its writing the old code in app.js file. What could be the reason I don't know. I am using Web Pack to run ./watch and generate the app.js file
Here is my Ember js code:
export default () => { 
 IMS.registerController("case.details.assignedinspector.edit", {

    caseDetails: Ember.inject.controller('caseDetails'),
    caseId: Ember.computed.alias('caseDetails.model.imscase.id'),
    clearForm: function () {
        $('.modal').modal('hide');
    },
    actions: {
        close: function (id) {
            $('.modal').modal('hide');
            this.transitionToRoute('case.details');
        },

        async save() {
            var scope = this;

            //validating form
            if ($("#edit-assignedinspector-form").validate()) {
                var data = {                    
                    AssignedToInvestigators: Ember.get(scope, 'model.imscase.assignedToInvestigators'), //AssignedToInspectorId: $("#assignedInspectorSelect").chosen().val(),
                    CaseId: this.get('caseId')
                };
                try {
                    let response = await this.api('Case/UpdateAssignedInvestigators').post(data);
                    $('.modal').modal('hide');
                    toastr.success("Assigned Inspector Edit Saved.");
                    scope.transitionToRoute("case.details");
                    scope.get('caseDetails').refreshData();
                    scope.clearForm();
                } catch (ex) {
                    toastr.error("Error saving Assigned Inspector.");
                }
            }
            else {
                toastr.warning("Please fix the form", "Validation failed");
            }
        },
        didInsert: function () {
            $('#edit-assignedinspector-modal').modal();
        }
    }
}); 
 }

Here is how its generating the old code in app.js file - any help please?
save: function () {
  var _save = _asyncToGenerator(
  /*#__PURE__*/
  regeneratorRuntime.mark(function _callee() {
    var scope, data, response;
    return regeneratorRuntime.wrap(function _callee$(_context) {
      while (1) {
        switch (_context.prev = _context.next) {
          case 0:
            scope = this; //validating form

            if (!$("#edit-assignedinspector-form").validate()) {
              _context.next = 19;
              break;
            }

            data = {
              AssignedToInspectorId: $("#assignedInspectorSelect").chosen().val(),
              CaseId: this.get('caseId')
            };
            _context.prev = 3;
            _context.next = 6;
            return this.api('Case/UpdateAssignedInspector').post(data);

          case 6:
            response = _context.sent;
            $('.modal').modal('hide');
            toastr.success("Assigned Inspector Edit Saved.");
            scope.transitionToRoute("case.details");
            scope.get('caseDetails').refreshData();
            scope.clearForm();
            _context.next = 17;
            break;

          case 14:
            _context.prev = 14;
            _context.t0 = _context["catch"](3);
            toastr.error("Error saving Assigned Inspector.");

          case 17:
            _context.next = 20;
            break;

          case 19:
            toastr.warning("Please fix the form", "Validation failed");

          case 20:
          case "end":
            return _context.stop();
        }
      }
    }, _callee, this, [[3, 14]]);
  }));

  function save() {
    return _save.apply(this, arguments);
  }

  return save;
}()

It is supposed to call Case/UpdateAssignedInvestigators instead its still calling the Case/UpdateAssignedInspector, which is incorrect.
Any help would be very very helpful - a link, a suggestion or even a code snippet anything helps thanks in advance.

modified 11-Mar-20 15:09pm.

QuestionHow can I get an input value from ajax result search Pin
vlafratta4-Mar-20 4:45
Membervlafratta4-Mar-20 4:45 
QuestionRe: How can I get an input value from ajax result search Pin
ZurdoDev4-Mar-20 5:12
mveZurdoDev4-Mar-20 5:12 
AnswerRe: How can I get an input value from ajax result search Pin
vlafratta5-Mar-20 3:39
Membervlafratta5-Mar-20 3:39 
GeneralRe: How can I get an input value from ajax result search Pin
ZurdoDev5-Mar-20 3:50
mveZurdoDev5-Mar-20 3:50 
GeneralRe: How can I get an input value from ajax result search Pin
vlafratta5-Mar-20 4:54
Membervlafratta5-Mar-20 4:54 
AnswerRe: How can I get an input value from ajax result search Pin
ZurdoDev5-Mar-20 5:10
mveZurdoDev5-Mar-20 5:10 
GeneralRe: How can I get an input value from ajax result search Pin
vlafratta16-Mar-20 1:41
Membervlafratta16-Mar-20 1:41 
SuggestionRe: How can I get an input value from ajax result search Pin
Richard Deeming6-Apr-20 1:30
mveRichard Deeming6-Apr-20 1:30 
QuestionFunction showMessage not available Pin
vinnie moag28-Feb-20 15:04
Membervinnie moag28-Feb-20 15:04 
AnswerRe: Function showMessage not available Pin
Richard MacCutchan28-Feb-20 22:45
mveRichard MacCutchan28-Feb-20 22:45 
Questiondrawing A Random Bezier Curve 10 times then reset Pin
LarsAlaska28-Feb-20 11:21
MemberLarsAlaska28-Feb-20 11:21 
AnswerRe: drawing A Random Bezier Curve 10 times then reset Pin
Graham Breach28-Feb-20 19:54
MemberGraham Breach28-Feb-20 19:54 
QuestionThere is some problem in my code I could not get the bus seat layout seats. Please help me Pin
Member 1465358023-Feb-20 22:45
MemberMember 1465358023-Feb-20 22:45 
SuggestionRe: There is some problem in my code I could not get the bus seat layout seats. Please help me Pin
Richard Deeming23-Feb-20 23:01
mveRichard Deeming23-Feb-20 23:01 
QuestionHow does this work in Javascript? Pin
Nand3210-Feb-20 23:25
MemberNand3210-Feb-20 23:25 
AnswerRe: How does this work in Javascript? Pin
Richard Deeming11-Feb-20 1:09
mveRichard Deeming11-Feb-20 1:09 
GeneralRe: How does this work in Javascript? Pin
Nand3211-Feb-20 1:27
MemberNand3211-Feb-20 1:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.