extjs - How to query a component by component name that contain some part of string -


i want use ext.componentquery.query() query name of button contain path of name.

assume have 4 button name declare 'edit_btn', 'add_btn', 'add2_btn' , 'edit2_btn'

then use query. ext.componentquery.query("button[name='*edit*']");

i should ''edit_btn'' , ''edit2_btn'' button.

ext.componentquery.query("button[name='*add*']");

i should ''add_btn'' , 'add2_btn' button.

or can use regex in ext.componentquery.query() command?

if can, how use it?

it's not implemented. looked @ source code, , there equality operator implemented. hovewer it's easy extend (see filterbyattribute in componentquery.html file), must copy code source, because it's implemented singleton.

another way select buttons have name attribute , filter later, eg:

ext.array.filter(     ext.componentquery.query('button[name]'),      function(c){ return /^add/.test(c.name); } ) 

Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -