ExtJs - 在extJs 3.4中按itemId获取元素 [英] ExtJs - Get element by itemId in extJs 3.4

查看:1455
本文介绍了ExtJs - 在extJs 3.4中按itemId获取元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取具有相同'itemId'的组件?使用ExtJS 3.4。

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

我有4个组合在不同的hbox布局与相同itemId。我需要得到所有这些combox的值。是否有任何API可用?

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

请帮助。

推荐答案

我通过对表单中的组件使用'hiddeName'解决了。通过Ext.query()我们可以得到所有的hbox形式,并从form.getValues()将提供组件的形式的值。

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();
   }

这篇关于ExtJs - 在extJs 3.4中按itemId获取元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆