sencha touch 2 Form动态提交

在这里lz使用了很笨的remove,add方法

1.

Ext.getCmp('testform').remove(Ext.getCmp('question'),true)


question是一个fieldset 
 
移除form中的一些item,全部清除可以用removeAll的办法
 
2.
record.pojoa().each(function(answerArray){
    	 //console.log(answerArray)
    	 var checkbox = {
    	 name:answerArray.id,
    	 xtype:'checkboxfield',
    	 label:answerArray.get('answerArray'),
    	 checked:answerArray.get('checked')
    	 };
    	 myfieldset.add(checkbox);
    	 });

 
添加到form的容器中
最后利用form的submit方法提交到服务器。。。。。。。
 
其中fieldset是动态生成的,最后添加到form中去了,整个项目只有一个form,不断的从从移除fieldset,添加新的
posted @ 2012-05-27 12:08  范永强  阅读(117)  评论(0编辑  收藏  举报