Results 1 to 6 of 6

Thread: cursor in non editable ComboBox

  1. #1
    Sencha User
    Join Date
    Apr 2008
    Location
    West Linton, Scotland
    Posts
    244

    Default cursor in non editable ComboBox

    I have a comboBox set up as an editor in a grid as follows:

    Code:
    var combo = new Ext.form.ComboBox({
                    hiddenName: 'content_group_id',
                    store: ['satisfied','disatisfied'],
                    listClass: 'x-combo-list-small',
                    forceSelection: true,
                    triggerAction: 'all',
                    editable:false
                })
    I am trying to allow a user to only select the options but on click of the combox box it shows the cursor to the right of the text of the first option.

    To me it indicates to the user that the box is looking for keyboard input.

    I could see no config option to prevent the cursor from appearing.
    Is there a way to stop the cursor appearing within the comboBox?

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    I don't think this is possible. The text is a HTML <input> element, which always shows a cursor when it has the focus.

  3. #3
    Ext JS Premium Member saJoshua's Avatar
    Join Date
    Nov 2007
    Location
    Sydney
    Posts
    526

    Default

    maybe you can try custom styling a Ext.Button with a Menu to look like a drop down list?

  4. #4
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    Yes, replacing the <input> with an <a> or <button> would work, but would also require a complete rewrite of ComboBox.

  5. #5
    Sencha User
    Join Date
    Apr 2008
    Location
    West Linton, Scotland
    Posts
    244

    Default

    Thanks gentlemen

    Interestingly enough I dont have the cursor in IE6 but do have it in FF although it does not blink in FF

  6. #6

    Default

    I had the same problem and just added a listener for the focus event in the handler of the render event to blur the dom element when the combo component focus event is raised... like this:

    Code:
    combobox.addListener('render', function(combo) {
    	combo.el.addListener('focus', function(event, htmlElement, options) {
    		try {
    			htmlElement.blur();
    		} catch (ex) {
    		}
    	});
    });

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •