Cannot read property 'show' of null backbone #813

jvonrudno opened this Issue Jan 2, 2017 · 0 comments


None yet

1 participant


Hi guys!!

I have the following situation:

myModel = Backbone.Model.extend({
url: myUrl,
categories: [],

myView = Marionette.LayoutView.extend({
this.model = new myModel();

   fillCategories: function (){
        url: otherURL,
        context: this,

        success: function(d){
            if(d ){
                this.model.set({categories: eval(d)});


I load the data for model attributes by fetch the model, using the url that I have define in the model, but I need to load the data for the attribute categories (This is a combobox field in the view) from another url (different table), for this reason in the method initialize I execute the method "fillCategories". In this method I execute an jquery ajax to get the data and set the attribute categories with this data.

All this task are working properly, but after execute the command to set the category i get in console the error message:
Uncaught TypeError: Cannot read property 'show' of null
at cmcom:1159
(anonymous) @ cmcom:1159

I am not sure if this is the best practice to fill the data from a combobox when this data come from a different table.

In advance, thousand thanks for your help!!


Jorge von Rudno

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment