2012-04-21 2 views
1

jQuery를 사용하여 양식의 필드를 복제했습니다.Web2py jQuery clone

$('#table_catalogues') 
    .clone() 
    .attr('id','table_catalogues_'+i2l) 
    .appendTo('#table_invoices_catalogues__row') 

하지만 web2py 그 필드를 생성하지 않습니다, 당신은 소스 에서 볼 수없는 데이터를 보낼 때 나는 예를 들어 찾을 :

사실
form.vars.catalogues = [1,2,3] 

내가 좋은 것을 발견하지만, 필요 이

Field(
    'catalogues', 
    db.catalogues, 
    requires=IS_IN_DB(db(db.catalogues.user_id==auth.user_id)(db.catalogues.useable==True), 
    'catalogues.id', 
    '%(catalogue_name)s' 
), 

내게 문제가되고 있습니다. 양식을 보낼 때 난 항상이 오류를 얻을 :

Value is not in Database

을 나는 IS_IN_SET()를 사용하려하고 목록에서 행을 내보낼 수있는 기능을 썼다, 그러나 나는이 오류를 얻을 :

Value is not allowed

답변

2

의 ID 변경을 복제 된 객체가 충분하지 않으면 name 속성도 변경해야합니다. 이름을 동일하게 유지하면 서식이 게시 될 때 원본 필드를 동일한 이름으로 덮어 씁니다.