The official release of Ext.NET Mobile is now available. Ext.NET Mobile is an ASP.NET component framework for building Phone and Tablet specific mobile web applications. Read More

[FIXED] [#1473] [4.2.0] ColorField does not use new value when the change was made in the RGB text fields

  1. #1

    [FIXED] [#1473] [4.2.0] ColorField does not use new value when the change was made in the RGB text fields

    Hi,

    There is an issue with the ColorField component, at least in Ext.Net 4.2: Selecting the color using the sliders and the 2D map works correctly, but using the text fields below the sliders doesn't. The picker will show the color correctly, but when clicking "OK" the change is not applied.

    To reproduce:
    1. Go to http://examples.ext.net/#/ColorPicke...nced/Overview/
    2. Click on the color button (or the color field - both components have the same issue) - It should be red by default.
    3. In the RGB text fields enter 0, 0, 255 - The picker will correctly show that blue is selected.
    4. Click OK.
    5. The button/field still remains red
    Click image for larger version. 

Name:	b.jpg 
Views:	1 
Size:	24.2 KB 
ID:	24938

    If you drag one of the sliders a tiny bit after changing the fields the change will be applied correctly.

    I've managed to trace the issue to how the "Ext.ux.colorpick.SelectorController" controller and the "Ext.ux.colorpick.Selection" viewmodel are wired up. The controller has an "initViewModel"-method which would wire up the "selectedColor" property to the view. However, this method is never called - "initViewModel" appears to be a method which should be called by the framework, but this doesn't happen (not sure why, my knowledge of Ext.js ViewModels is fairly limited).

    For now we're using this override to fix this issue:
    Ext.define(null, {
        override: "Ext.ux.colorpick.Selector",
    
        constructor: function() {
            this.callParent(arguments);
            this.controller.initViewModel();
        }
    });
    There's also a second (but minor) issue: The color field displays the hex code of the selected color, but not the actual color like the button does:
    Click image for larger version. 

Name:	a.png 
Views:	0 
Size:	8.8 KB 
ID:	24937

    We fixed this by using this CSS rule:
    .x-colorpicker-field-swatch-inner {
        z-index: 1;
    }
    Both issues reproduce in Chrome 57.0.2987.133, Firefox 53.0.2 and Internet Explorer 11.1066.14393.0.
    Last edited by fabricio.murta; May 19, 2017 at 1:04 AM.
  2. #2
    Hello @ilogsdev02!

    Thanks for both reporting the issue and providing the workarounds that worked for you!

    But we won't leave it at that! We've logged this bug under issue #1473, and we'll post here an update as soon as we place a fix in our code (or once Ext.NET is upgraded with a Sencha ExtJS version that is not affected).

    It seems this time we're at fault, I couldn't reproduce this issue if using the same component.

    And for the second issue you pointed, we've logged it under #1474. This one is reproducible using ExtJS alone.
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hello again!

    We've just fixed the issue with the color selector! The updated version of Ext.NET is available on github!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 2
    Last Post: Jul 11, 2012, 6:18 PM
  2. [CLOSED] Colorfield in Propertygrid. Allow empty
    By CarWise in forum 1.x Premium Help
    Replies: 2
    Last Post: Jun 20, 2011, 12:56 PM
  3. [CLOSED] Colorfield ?
    By CarWise in forum 1.x Premium Help
    Replies: 2
    Last Post: Jun 16, 2011, 7:47 AM
  4. [CLOSED] Combobox value and text fields
    By dnguyen in forum 1.x Premium Help
    Replies: 9
    Last Post: Nov 19, 2010, 3:59 PM
  5. Replies: 12
    Last Post: Jun 17, 2009, 1:07 PM

Posting Permissions