PDA

View Full Version : [CLOSED] Disabled Style applied incorrectly



softmachine2011
Aug 28, 2012, 9:32 AM
Hi,

I created a test case with the error that I reproduce in my MVC project.
When you have it loaded, press buttons 3 and 4 or 4 and 3 to enable tabpanel and formpanel and you'll see controls are enable (you can write and click it) but css style looks like if the control is disabled.

SAMPLE PAGE


<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:Panel runat="server" Layout="HBoxLayout">
<Items>
<ext:Button runat="server" Text="1-Disable Form">
<Listeners>
<Click Handler="myForm.setDisabled(true);" />
</Listeners>
</ext:Button>
<ext:Button runat="server" Text="2-Disable Tab">
<Listeners>
<Click Handler="myTab.setDisabled(true);" />
</Listeners>
</ext:Button>
<ext:Button runat="server" Text="3-Enable Form">
<Listeners>
<Click Handler="myForm.setDisabled(false);" />
</Listeners>
</ext:Button>
<ext:Button runat="server" Text="4-Enable Tab">
<Listeners>
<Click Handler="myTab.setDisabled(false);" />
</Listeners>
</ext:Button>
</Items>
</ext:Panel>
<ext:FormPanel ID="myForm" runat="server">
<Items>
<ext:TabPanel ID="myTab" runat="server">
<Items>
<ext:Panel ID="MyPanel" runat="server" Layout="FitLayout" Title="Panel with partial view" Height="500">
<Loader runat="server" Url="/Area/Sample/MyPartialView" Mode="Script" TriggerEvent="activate">
<LoadMask ShowMask="true" Msg="Custom loading message..." UseMsg="true" />
<Params>
<ext:Parameter Name="containerId" Value="#{MyPanel}" Mode="Value" />
<ext:Parameter Name="dummy" Value="(new Date()).getTime()" Mode="Raw" />
</Params>
</Loader>
<Listeners>
<BeforeRender Handler="myForm.setDisabled(true);myTab.setDisabled(true);" />
</Listeners>
</ext:Panel>
<ext:Panel ID="MyPanel2" runat="server" Layout="FitLayout" Title="Panel with partial view 2" Height="500">
<Loader runat="server" Url="/Area/Sample/MyPartialView" Mode="Script" TriggerEvent="activate">
<LoadMask ShowMask="true" Msg="Custom loading message..." UseMsg="true" />
<Params>
<ext:Parameter Name="containerId" Value="#{MyPanel2}" Mode="Value" />
<ext:Parameter Name="dummy" Value="(new Date()).getTime()" Mode="Raw" />
</Params>
</Loader>
</ext:Panel>
</Items>
</ext:TabPanel>
</Items>
</ext:FormPanel>

</form>
</body>
</html>



PARTIAL VIEW CONTENT


<ext:Panel runat="server">
<Items>
<ext:TextField runat="server" />
<ext:ComboBox runat="server">
<Items>
<ext:ListItem Text="Item" Value="1" />
</Items>
</ext:ComboBox>
</Items>
</ext:Panel>


CONTROLLER TO LOAD PARTIAL VIEW


public ActionResult MyPartialView(string containerId)
{
Ext.Net.MVC.PartialViewResult r = new Ext.Net.MVC.PartialViewResult(containerId, Ext.Net.RenderMode.AddTo);
r.SingleControl = true;
r.WrapByScriptTag = false;
return r;
}

Daniil
Aug 28, 2012, 11:36 AM
Hi,

Please set the Disabled property to true instead of

<BeforeRender Handler="myForm.setDisabled(true); myTab.setDisabled(true);" />

Or use the Render event instead of BeforeRender.

Though, I think you scenario should work. Probably, something is going wrong within the setDisabled function or somewhere. Here is a bug report for Sencha.
http://www.sencha.com/forum/showthread.php?239769

softmachine2011
Aug 28, 2012, 11:45 AM
Hi,

Please set the Disabled property to true instead of

<BeforeRender Handler="myForm.setDisabled(true); myTab.setDisabled(true);" />

Or use the Render event instead of BeforeRender.

Though, I think you scenario should work. Probably, something is going wrong within the setDisabled function or somewhere. Here is a bug report for Sencha.
http://www.sencha.com/forum/showthread.php?239769

Well, I know this option but is it not possible in my scenario, I reproduced a test case only for you to test it.

Thanks

Daniil
Aug 28, 2012, 11:57 AM
Thank you.

Please clarify can you use a Render listener instead of the BeforeRender one for now?

softmachine2011
Aug 28, 2012, 12:04 PM
Well like I see you in previous post this is only an example to reproduce.

In my project I use an Ext.onReady with formPanel.setDisabled(true) inside of it.
I'll wait for fix in Ext.JS because I'm migration all application to Ext.NET 2.1 and work on it (with only visual issue) is waste time in something that will be corrected.

If you need to close thread, do it.

Daniil
Aug 28, 2012, 12:49 PM
In my project I use an Ext.onReady with formPanel.setDisabled(true) inside of it.


Ok, thanks for clarification. Then I can suggest this solution for now.

<ext:Button runat="server" Text="3-Enable Form">
<Listeners>
<Click Handler="myForm.setDisabled(false);
myForm.body.removeCls('x-item-disabled');" />
</Listeners>
</ext:Button>
<ext:Button runat="server" Text="4-Enable Tab">
<Listeners>
<Click Handler="myTab.setDisabled(false);
myTab.body.removeCls('x-item-disabled');" />
</Listeners>
</ext:Button>




If you need to close thread, do it.

No, thanks. We leave it unclosed till it will be fixed by Sencha and incorporated to Ext.NET.

By the way, Sencha already opened a bug ticket.

softmachine2011
Aug 28, 2012, 1:33 PM
Ok thanks I'll try it but I await for Ext.JS fix

softmachine2011
Aug 29, 2012, 9:23 AM
Hi, I saw that bug ticket was fixed in 4.1.3 but now we are in 4.1.1 as I know.

Do you know where I can find a roadmap of extjs versions?

Daniil
Aug 29, 2012, 11:06 AM
Do you know where I can find a roadmap of extjs versions? Recently, I tried to find it without success. Also some ExtJS team member told a few days ago there is no date for 4.1.2 yet.

softmachine2011
Aug 29, 2012, 1:33 PM
Ok thanks.

softmachine2011
Sep 21, 2012, 8:34 AM
Fixed with Ext.JS 4.1.2 (tested in Ext.NET rev 4363)

Daniil
Sep 21, 2012, 11:54 AM
Thank you for confirming!