PDA

View Full Version : [CLOSED] [2.5] The whole page gets scrolled up when clicking a checkbox



FVNoel
May 19, 2014, 4:09 PM
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?25621-CLOSED-2-1-ValidationStatus-plugin-scrolling-the-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);
}
});

Daniil
May 19, 2014, 4:24 PM
Hi @FVNoel,

Please provide a full test case to reproduce the problem.

FVNoel
May 19, 2014, 4:46 PM

Daniil
May 19, 2014, 4:58 PM
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.

FVNoel
May 19, 2014, 5:18 PM

Daniil
May 20, 2014, 7:14 AM
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>