[CLOSED] [2.5] The whole page gets scrolled up when clicking a checkbox

  1. #1

    [CLOSED] [2.5] The whole page gets scrolled up when clicking a checkbox

    Hello, I had the same issue with older versions of Ext.Net, but it was fixed with an override. The issue is described in this post:
    http://forums.ext.net/showthread.php...he-document-up

    The problem is after updating Ext.Net to the 2.5 release, the ValidationStatus override does no longer work, and the form keeps scrolling up everytime i click a CheckBox.

    I have tried adding a 'debugger;' line to see what is going on, but it never reaches the onFieldValidation function:

            Ext.ux.statusbar.ValidationStatus.override({
                onFieldValidation: function (f, isValid) {
                
                    debugger;
    
    
                    var me = this,
                        msg,
                        formPanelBody = App.Objeto_FormPanel_Consulta.getBody(),
                        scroll = formPanelBody.getScroll();
    
    
                    if (!me.monitor) {
                        return false;
                    }
    
    
                    msg = f.getErrors()[0];
                    if (msg) {
                        me.errors.add(f.id, { field: f, msg: msg });
                    } else {
                        me.errors.removeAtKey(f.id);
                    }
    
    
                    this.updateErrorList();
                    if (me.errors.getCount() > 0) {
                        if (me.statusBar.getText() !== me.showText) {
                            me.statusBar.setStatus({
                                text: me.showText,
                                iconCls: me.errorIconCls
                            });
                        }
                    } else {
                        me.statusBar.clearStatus().setIcon(me.validIconCls);
                    }
    
    
                    formPanelBody.scrollTo('top', scroll.top);
                    formPanelBody.scrollTo('left', scroll.left);
                }
            });
    Last edited by Daniil; May 28, 2014 at 4:26 AM. Reason: [CLOSED]
  2. #2
    Hi @FVNoel,

    Please provide a full test case to reproduce the problem.
  3. #3

    Example

  4. #4
    Code behind, please.

    Please include it directly to the page wrapping in
    <script runat="server">
    </script>
    Please use
    <%@ Page Language="vb" %>
    instead of
    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Test.aspx.vb" Inherits="WebApplication2.Test" %>
    Please re-post a full test case and ensure it runnable without any changes.
  5. #5

    Full code

  6. #6
    Thank you. Your page throws a JavaScript error "Ext is not defined". You should put the override script into the page's <head>.

    Also please replace
    formPanelBody = App.Objeto_FormPanel_Consulta.getBody()
    with
    formPanelBody = App.Objeto_FormPanel_Consulta.body
    It is a known API issue:
    https://github.com/extnet/Ext.NET/issues/470

    Also a FormPanel scrolls at first Checkbox click even if there is no a StatusBar at all. To overcome it, please add this for the CheckboxGroup.
    <Listeners>
        <AfterRender Handler="this.validate();" />
    </Listeners>

Similar Threads

  1. Replies: 8
    Last Post: Dec 19, 2014, 10:54 PM
  2. Replies: 1
    Last Post: Sep 08, 2013, 5:10 AM
  3. Replies: 1
    Last Post: Jun 25, 2013, 12:14 PM
  4. Replies: 0
    Last Post: Mar 25, 2010, 7:59 PM
  5. Move a window when the page is scrolled
    By fquintero in forum 1.x Help
    Replies: 0
    Last Post: Nov 23, 2009, 6:16 PM

Posting Permissions