-1

I have the following code in my controller. This works fine in Internet Explorer 9 and Firefox. However, I get "aw snap!. Something went wrong ..." error message in Chrome.

init: function () {
    this.control({
        'jobslist': {
            selectionchange: this.onJobSelect
        },
        'jobdetail button[action=create]': {
            click: this.onNewJobSelect
        },
        'jobdetail button[action=save]': {
            click: this.onJobUpdate
        },
        'jobform button[action=remove]': {
            click: this.onJobRemove
        }
    });
},

onLaunch: function () {
    var jobsStore = this.getJobsStore();
    jobsStore.load({
        callback: this.onJobsLoad,
        scope: this
    });
},

onJobUpdate: function (selection) {
    var form = Ext.getCmp('jobForm');
    var record = form.getRecord();
    var values = form.getValues();
    record.set(values);
}
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
frosty
  • 5,330
  • 18
  • 85
  • 122

2 Answers2

1
init: function () {
        this.control({
           , <------ here
            'jobdetail button[action=save]': {
                click: this.onJobUpdate
            }
        });
    },

You have a blank value in your object. This is probably breaking it.

Diodeus - James MacFarlane
  • 112,730
  • 33
  • 157
  • 176
-1

Finally, after much trouble resolved this. My view was extending grid:

Ext.define('MyApp.view.PartForm', {
    extend: 'Ext.grid.Panel',

It should have been

Ext.define('MyApp.view.PartForm', {
    extend: 'Ext.panel.Panel',
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
frosty
  • 5,330
  • 18
  • 85
  • 122