2017-03-05 13 views
0

我需要你的帮助。我已经更新自动窗体到6.0版本,我的方式是不行的,我得到这个错误:Uncaught TypeError:ss.getQuickTypeForKey不是Object.autoFormGetInputValue的函数

Uncaught TypeError: ss.getQuickTypeForKey is not a function 
at Object.autoFormGetInputValue [as getInputValue] (autoform-api.js:493) 
at HTMLInputElement.<anonymous> (autoform-inputs.js:6) 

我的模板。html的自动窗体:在这里我有一个简单的插入自动窗体以便插入图像参考和数据。

<template name="insertArtForm"> 
    {{#autoForm collection=artCollection doc=user id="insertArtForm" type="insert"}} 
     <fieldset> 
     {{> afQuickField name='createdBy' type='hidden' defaultValue=user._id}} 
     {{> afQuickField name='createdOn' type='hidden' defaultValue=today}} 
     <h4>Resolución</h4> 
     <div class="container"> 
      {{> afQuickField formgroup-class="col-md-1" name='width' type='number'}} 
      <p class='col-md-1'>x</p> 
      {{> afQuickField formgroup-class="col-md-1" name='height' type='number'}} 
     </div> 
     {{> afQuickField name='name' type='text'}} 
     {{> afQuickField name='description' type='textarea'}} 
     {{> afQuickField name='prixQuote' type='text'}} 
     {{> afQuickField name='artURL' type='text'}} 
     </fieldset> 
     <button type="submit" class="btn btn-default" id="js-insert-art-form">Guardar</button> 
    {{/autoForm}} 
</template> 

我的.js事件:

Template.insertArtForm.events({ 
    "click #js-insert-art-form": function(e){ 
    console.log("entra en el evento"); 
    $(".js-save-label").css("visibility","visible"); 
    window.setTimeout(function() { 
       $(".js-save-label").fadeTo(500, 0).slideUp(500, function(){ 
        $(this).remove(); 
       }); 
      }, 3000); 
    } 
}); 

我的架构:

import { Mongo } from 'meteor/mongo'; 
import { Index, MinimongoEngine } from 'meteor/easy:search'; 
import SimpleSchema from 'simpl-schema'; 
SimpleSchema.extendOptions(['autoform']); 
/*Create and export Arts Collection*/ 
export const Arts = new Mongo.Collection('arts'); 
/*Arts index for easy:search*/ 
export const ArtIndex = new Index({ 
    collection: Arts, 
    fields: ['name'], 
    engine: new MinimongoEngine(), 
}); 

//Define Art schema 
Arts.schema = new SimpleSchema({ 
    createdBy: { //Owner 
     type: String, 
     label: "Artista", 
     regEx: SimpleSchema.RegEx.Id, 
     optional: true 
    }, createdOn: { 
     type: Date, 
     label: "Fecha", 
     optional: true 
    }, height: { 
     type: String, 
     label: "Alto", 
     optional: true 
    }, width: { 
     type: String, 
     label: "Ancho", 
     optional: true 
    }, name: { 
     type: String, 
     label: "Nombre de la obra", 
     optional: true 
    }, description: { 
     type: String, 
     label: "Descripción de la obra", 
     optional: true 
    }, prixQuote: { 
     type: String, 
     label: "PrixQuote", 
     optional: true 
    }, artURL: { 
     type: String, 
     label: "URL de la obra", 
     optional: true 
    } 
}); 

/*Attach the Arts schema for automatic validations*/ 
Arts.attachSchema(Arts.schema); 

我真的很绝望。

回答

0

我也有这个问题。请确保在您的packages.json中安装了最新节点simpl-schema。我升高到"simpl-schema": "0.2.3"并且错误消失了。

+0

谢谢你!它解决了我的问题!真棒 – CapuzR

相关问题