PDA

View Full Version : [CLOSED] Fieldset collapse codebehind



CarWise
Aug 02, 2012, 2:29 PM
Can't figure out how to check the collapsing of a fieldset in codebehind.
This is what I have (testpage):
Collapse is always true...



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="fsTest.aspx.cs" Inherits="Test_fsTest" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Nieuw</title>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:FormPanel ID="fpReception" runat="server" Title="" Frame="true" BodyPadding="5" heigth="400">
<Items>
<ext:FieldSet ID="fsCluster" runat="server" CheckboxToggle="true" Title="Cluster issue"
AutoHeight="true" Collapsed="true" CheckboxName="chbCluster" HideMode="Offsets"
Height="100">
<Items>
<ext:Label runat="server" Text="Open" ID="tfOpen"/>
</Items>
<listeners>
<Collapse Handler="App.direct.checkCollapse()" />
</listeners>
</ext:FieldSet>

<ext:label runat="server" id="lblCollapsed"/>
</Items>
</ext:FormPanel>
</form>
</body>
</html>




CodeBehind:



using System;
using Ext.Net;


public partial class Test_fsTest : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!ExtNet.IsAjaxRequest)
{
tfOpen.Text = "Check";
}
}


[DirectMethod]
public void checkCollapse()
{
tfOpen.Text = String.Format("Collapsed: {0}", fsCluster.Collapsed);
}
}

Daniil
Aug 02, 2012, 4:07 PM
Hi,

Via an extra parameter. This info is not sent from client to server automatically.

CarWise
Aug 03, 2012, 6:51 AM
Will do Daniil,

Just checking if it wasn't a bug :)

Regards,

Martin

Daniil
Aug 03, 2012, 8:23 AM
Yes, it would be too hard task to mirror all client side changes to server.