Skip to content

Error: checked is not in the [object Object] #107

Closed
@dukye

Description

Hello

Thx for this wonderful admin :)

I have a problem using a simple-schema attached to a collection.

Schema.Tasks = new SimpleSchema({
  text: {
    type: String,
  },
  owner: {
    type: String,
    autoform: {
      type: "select",
      options: function() {
        var model = Meteor.users.find().fetch();
        var el = [];
        _.each(model, function (obj){
          var name = 'no-username';
          if ( obj.profile ) {
            name = obj.profile.name;
          }
          if ( obj.username ) {
            name = obj.username;
          }
          name += ( obj.emails ? ' ('+obj.emails[0].address+')' : '' );

          el.push({
            label: name,
            value: obj._id,
          });
        })
        return el;
      }
    }
  },
  checked: {
    type: Boolean,
    optional: true,
    autoform: {
      type: "boolean-checkbox",
      afFieldInput: {
        type: "boolean-checkbox"
      }
    }
  },
  createdAt: {
    type: Date,
    autoform: {
      type: "date",
      afFieldInput: {
        type: "date"
      }
    }
  }
});

When task not marked as down ( because false ) this error (below) is returned. When task marked 'complete' ( true as value ) error disappear, normal ...

Exception in template helper: Error: checked is not in the [object Object]
    at lookup (http://localhost:3000/packages/yogiben_admin.js?a7fdf607290112b2513222ed9a85385d419be89a:362:13)
    at Object.<anonymous> (http://localhost:3000/packages/yogiben_admin.js?a7fdf607290112b2513222ed9a85385d419be89a:1689:92)
    at http://localhost:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:2727:16
    at http://localhost:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:1606:16
    at Spacebars.call (http://localhost:3000/packages/spacebars.js?3c496d2950151d744a8574297b46d2763a123bdf:169:18)
    at Spacebars.mustacheImpl (http://localhost:3000/packages/spacebars.js?3c496d2950151d744a8574297b46d2763a123bdf:106:25)
    at Object.Spacebars.mustache (http://localhost:3000/packages/spacebars.js?3c496d2950151d744a8574297b46d2763a123bdf:110:39)
    at null._render (http://localhost:3000/packages/yogiben_admin.js?a7fdf607290112b2513222ed9a85385d419be89a:854:44)
    at doRender (http://localhost:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:1866:25)
    at http://localhost:3000/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:1808:16
this.lookup = function(obj, root) {
    ...
    if (!ref) {
      throw new Error(obj + ' is not in the ' + root.toString());
    }
    ...
};

Thx in advance

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions