ExtJs - Get element by itemId in extJs 3.4

Deadly 提交于 2019-12-23 05:29:32

问题


How do i get the components with same 'itemId'? using ExtJS 3.4.

I have 4 combos in different hbox layout with same itemId. I need get the values of all these combox. Is there any api's available for this?

  form1  
    row1 combo1
  form1
    row2 combo2
  form1
    row3 combo3
  form1
    row4 combo4

Please help.


回答1:


I solved it by using 'hiddeName' for components inside the form. Through Ext.query() we can get all the hbox forms and from that form.getValues() will provide the values of components inside the form.

   forms = Ext.query(#formId); 
   for (var i=0; i < forms.length; i ++) {
     formValues = new Ext.form.BasicForm(forms[i]).getValues();
   }


来源:https://stackoverflow.com/questions/12142802/extjs-get-element-by-itemid-in-extjs-3-4

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!