2017-03-05 2 views
0

당신의 도움이 필요합니다.잡히지 않은 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 자동 폼 : 나는 버전 6.0 폼을 업데이트 한 내 양식이 작동하지 않습니다, 나는이 오류가 발생했습니다 나는 여기 이미지 참조 및 데이터를 삽입하기 위해 간단한 삽입 폼을 가지고있다.

<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

관련 문제