[CLOSED] handling SetValue differently for checkboxes

  1. #1

    [CLOSED] handling SetValue differently for checkboxes

    Support,
    pls run this example v3 and in v4. in v3, SetValue(1) was sufficient to check it. in v4, it doesnt work.
    Thanks,
    /Z


    <%@ Page Language="C#" %>
    
    
    <!DOCTYPE html>
    
    
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
    
    
        <script type="text/javascript">
            var test = function (value) {
                App.myChk.setValue(true);
                alert('true- should be checked now');
                App.myChk.setValue(false);
                alert('false - should be unchecked now');
                App.myChk.setValue(1);
                alert('1- should be checked now');
                App.myChk.setValue(0);
                alert('0 - should be unchecked now');
    
    
                alert(1 == true);
                alert(1 === true);
            }
        </script>
    
    
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager runat="server">
            <Listeners>
                <DocumentReady Handler="test()" />
            </Listeners>
        </ext:ResourceManager>
        <ext:Checkbox runat="server" ID="myChk" Disabled="true">
        </ext:Checkbox>
        </form>
    </body>
    </html>
    Last edited by fabricio.murta; Sep 22, 2017 at 10:09 PM. Reason: no feedback from the user in 7+ days
  2. #2
    Hello @Z!

    According to the documentation on setValue() for ExtJS 5.1.2 (pertaining to Ext.NET 3), providing an integer/number is supposed to uncheck the box. The same documentation text is present on ExtJS 6.2.1, which applies to Ext.NET 4.2.2.

    So, I'm afraid you never should have relied in an integer/number passed to the checkbox's setValue() method to start with, and we'd rather assume it as a bug in 3.x (although minor) than a breaking change to 4.x.

    We hope you understand.
    Fabrício Murta
    Developer & Support Expert
  3. #3
    So you are saying, since i used a number, it unchecked? but if i had used the string 1, it would have been fine?
    so a bug in all prior sencha versions "fixed" in v6.
    thanks.
    /Z
  4. #4
    Yes, @Z! I agree this is strange, but that's whats written in their docs, I can't argue with that. Probably somebody raised them the complaint about the docs not matching the actual behavior and then this was "fixed". In JavaScript context I think it would be alright to accept a "true-ish" value (like a non-null object, a number different than zero), but seems they designed it to be strict about what should check a box. This probably was in favor of supporting some other feature, for example their support to provide an array of 'names' of checkboxes to check in a group...

    I hope you understand this is beyond us on Ext.NET, to determine some design aspects of ExtJS.
    Fabrício Murta
    Developer & Support Expert
  5. #5
    Hello @Z!

    It's been a while since we replied here and still no feedback from you.

    While this is not something we can commit to Ext.NET (as going against an ExtJS documentation's statement), if you really want this behavior, you can just make a simple override to the component so that it treats a number parameter to setValue() the way you need (as Ext.NET 3 did) and, maybe, add this override to a file you include on all your pages that use this checkbox column component.

    We'll wait another 7 days before marking this thread as closed. After that time, provided you didn't leave a follow-up here, we will be marking the thread as closed at any time. As always, we don't lock up the thread, you will be able to post back here anytime you need or decides its worth.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] Application behaving differently in Staging enviroment
    By otouri in forum 2.x Legacy Premium Help
    Replies: 10
    Last Post: Jan 08, 2013, 4:08 PM
  2. Replies: 1
    Last Post: Apr 09, 2012, 10:46 AM
  3. Rendering column differently
    By maephisto in forum 1.x Help
    Replies: 1
    Last Post: Apr 13, 2011, 8:20 PM
  4. Replies: 1
    Last Post: Oct 16, 2010, 6:53 PM
  5. Replies: 0
    Last Post: Aug 28, 2008, 5:09 PM

Posting Permissions