Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readOnly mode not displayed correctly #43

Open
zgrzybek opened this issue Dec 15, 2014 · 0 comments
Open

readOnly mode not displayed correctly #43

zgrzybek opened this issue Dec 15, 2014 · 0 comments

Comments

@zgrzybek
Copy link

Setting readOnly on BoxSelect doesn't set readonly attribute on input element, therefore a user is still able to type in new value.

To resolve that new line must be added to fieldSubTpl. which is:

'<tpl if="readOnly"> readonly="readonly"</tpl>',

To fix change:

fieldSubTpl: [
    '<div id="{cmpId}-listWrapper" class="x-boxselect {fieldCls} {typeCls}">',
    '<ul id="{cmpId}-itemList" class="x-boxselect-list">',
    '<li id="{cmpId}-inputElCt" class="x-boxselect-input">',
    '<div id="{cmpId}-emptyEl" class="{emptyCls}">{emptyText}</div>',
    '<input id="{cmpId}-inputEl" type="{type}" ',
    '<tpl if="name">name="{name}" </tpl>',
    '<tpl if="value"> value="{[Ext.util.Format.htmlEncode(values.value)]}"</tpl>',
    '<tpl if="size">size="{size}" </tpl>',
    '<tpl if="tabIdx">tabIndex="{tabIdx}" </tpl>',
    '<tpl if="disabled"> disabled="disabled"</tpl>',
    'class="x-boxselect-input-field {inputElCls}" autocomplete="off">',
    '</li>',
    '</ul>',
    '</div>',
    {
        compiled: true,
        disableFormats: true
    }
],

to

fieldSubTpl: [
    '<div id="{cmpId}-listWrapper" class="x-boxselect {fieldCls} {typeCls}">',
    '<ul id="{cmpId}-itemList" class="x-boxselect-list">',
    '<li id="{cmpId}-inputElCt" class="x-boxselect-input">',
    '<div id="{cmpId}-emptyEl" class="{emptyCls}">{emptyText}</div>',
    '<input id="{cmpId}-inputEl" type="{type}" ',
    '<tpl if="name">name="{name}" </tpl>',
    '<tpl if="value"> value="{[Ext.util.Format.htmlEncode(values.value)]}"</tpl>',
    '<tpl if="size">size="{size}" </tpl>',
    '<tpl if="tabIdx">tabIndex="{tabIdx}" </tpl>',
    '<tpl if="disabled"> disabled="disabled"</tpl>',
    '<tpl if="readOnly"> readonly="readonly"</tpl>',
    'class="x-boxselect-input-field {inputElCls}" autocomplete="off">',
    '</li>',
    '</ul>',
    '</div>',
    {
        compiled: true,
        disableFormats: true
    }
],
@zgrzybek zgrzybek changed the title setReadOnly doesn't set readOnly on input element readOnly mode not displayed correctly Dec 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant