Uploaded image for project: 'Runtime'
  1. Runtime
  2. RUNTIME-1977

JS error when selecting a color with color picker widget

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.0M11
    • None
    • None
    • None

      ext-all-debug.js:2585 Uncaught Error: Invalid id selector: ""
      

          [RUNTIME-1977] JS error when selecting a color with color picker widget

          May be a issue on ExtJS ColorPicker ? It seems that is missing a id on button to pick the color.
          I tried with this patch, and I had no error :

          Index: main/plugin-core-ui/resources/js/Ametys/form/field/ColorSelector.js
          ===================================================================
          --- main/plugin-core-ui/resources/js/Ametys/form/field/ColorSelector.js	(revision 42507)
          +++ main/plugin-core-ui/resources/js/Ametys/form/field/ColorSelector.js	(working copy)
          @@ -167,6 +167,13 @@
           					xtype: 'colorpicker',
           					handler: this._onColorPickerSelect,
           					scope: this,
          +					renderTpl: [
          +					            '<tpl for="colors">',
          +					                '<a href="#" role="button" id="{parent.id}-color-{.}" class="color-{.} {parent.itemCls}" hidefocus="on">',
          +					                    '<span class="{parent.itemCls}-inner" style="background:#{.}">&#160;</span>',
          +					                '</a>',
          +					            '</tpl>'
          +					        ],
           					height: "auto",
                               width: "auto"
           				}, colorInfos)
          

          Laurence Aumeunier added a comment - May be a issue on ExtJS ColorPicker ? It seems that is missing a id on button to pick the color. I tried with this patch, and I had no error : Index: main/plugin-core-ui/resources/js/Ametys/form/field/ColorSelector.js =================================================================== --- main/plugin-core-ui/resources/js/Ametys/form/field/ColorSelector.js (revision 42507) +++ main/plugin-core-ui/resources/js/Ametys/form/field/ColorSelector.js (working copy) @@ -167,6 +167,13 @@ xtype: 'colorpicker', handler: this._onColorPickerSelect, scope: this, + renderTpl: [ + '<tpl for="colors">', + '<a href="#" role="button" id="{parent.id}-color-{.}" class="color-{.} {parent.itemCls}" hidefocus="on">', + '<span class="{parent.itemCls}-inner" style="background:#{.}">&#160;</span>', + '</a>', + '</tpl>' + ], height: "auto", width: "auto" }, colorInfos)

          Due to focus ?

          The call stacktrace is :

          Ext.Error	@	ext-all-debug.js:2585
          raise	@	ext-all-debug.js:2644
          Ext.raise	@	ext-all-debug.js:2723
          makeIdSelector	@	ext-all-debug.js:1873
          blur	@	AbstractFieldsWrapper.js:132
          fire	@	ext-all-debug.js:20326
          doFireEvent	@	ext-all-debug.js:21244
          doFireEvent	@	ext-all-debug.js:65377
          prototype.doFireEvent	@	ext-all-debug.js:55078
          fireEventArgs	@	ext-all-debug.js:21097
          fireEvent	@	ext-all-debug.js:21056
          onBlur	@	ext-all-debug.js:62029
          handleBlurEvent	@	ext-all-debug.js:62343
          onGlobalFocus	@	ext-all-debug.js:26977
          fire	@	ext-all-debug.js:20326
          doFireEvent	@	ext-all-debug.js:21244
          prototype.doFireEvent	@	ext-all-debug.js:55078
          fireEventArgs	@	ext-all-debug.js:21097
          fireEvent	@	ext-all-debug.js:21056
          processFocusIn	@	ext-all-debug.js:114958
          doDelegatedEvent	@	ext-all-debug.js:114900
          onDelegatedEvent	@	ext-all-debug.js:32697
          (anonymous function)	@	ext-all-debug.js:6696
          

          Laurence Aumeunier added a comment - Due to focus ? The call stacktrace is : Ext.Error @ ext-all-debug.js:2585 raise @ ext-all-debug.js:2644 Ext.raise @ ext-all-debug.js:2723 makeIdSelector @ ext-all-debug.js:1873 blur @ AbstractFieldsWrapper.js:132 fire @ ext-all-debug.js:20326 doFireEvent @ ext-all-debug.js:21244 doFireEvent @ ext-all-debug.js:65377 prototype.doFireEvent @ ext-all-debug.js:55078 fireEventArgs @ ext-all-debug.js:21097 fireEvent @ ext-all-debug.js:21056 onBlur @ ext-all-debug.js:62029 handleBlurEvent @ ext-all-debug.js:62343 onGlobalFocus @ ext-all-debug.js:26977 fire @ ext-all-debug.js:20326 doFireEvent @ ext-all-debug.js:21244 prototype.doFireEvent @ ext-all-debug.js:55078 fireEventArgs @ ext-all-debug.js:21097 fireEvent @ ext-all-debug.js:21056 processFocusIn @ ext-all-debug.js:114958 doDelegatedEvent @ ext-all-debug.js:114900 onDelegatedEvent @ ext-all-debug.js:32697 (anonymous function) @ ext-all-debug.js:6696

            laurence Laurence Aumeunier
            laurence Laurence Aumeunier
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: