PDA

View Full Version : 4.2.0: Uncaught Invalid ComponentQuery selector: "]"



SimonTemple
12 Jun 2013, 6:25 AM
I have a tab panel with a title of '[Hello]'

If I try and select this component using a component query with attribute selector:

panel[title="[Hello]"]

it fails with

Uncaught Invalid ComponentQuery selector: "]"


tabs.child( 'panel[title=' + selected.data.name + ']' ))

I've tried various ways of escaping the attribute selector but have failed to hit a combination that works.

Is this a bug in Ext? Is there a way of using an attribute selector with an attribute value that contains square brackets?

slemmon
14 Jun 2013, 9:45 AM
The [ ] characters are reserved within component query today. But, the following may work for you - searches for any panel with a title starting with [Hello



Ext.widget('panel', {
renderTo: document.body,
title: 'Foo',
layout: 'fit',
items: [{
xtype: 'panel',
title: '[Hello]'
}]
});


console.log(Ext.ComponentQuery.query('panel[title^="[Hello"]'));