Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

Commit

Permalink
Fixes display issues with the FieldNote Overview example.
Browse files Browse the repository at this point in the history
One of ths issues were introduced by chrome 56 and is reported under
extnet/Ext.NET#1428. This should be reverted as soon as the issue (or
chrome) is fixed.

It also adds mechanism to make the form panel fit its contents depending
on the theme.

Related github issue: #12.

Issue extnet/Ext.NET#1431 tracks removing this override on next Ext.NET
public update.
  • Loading branch information
fabriciomurta committed Feb 10, 2017
1 parent b8a3935 commit 31db645
Showing 1 changed file with 47 additions and 1 deletion.
48 changes: 47 additions & 1 deletion src/Examples/Form/Field_Note/Overview/Default.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,47 @@

<!DOCTYPE html>

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
// This page has no postback/ajax interactions so we don't test for it
// the code below just binds a good height/width to the panel depending on the active theme
var curTheme = Ext.Net.ResourceManager.GetInstance(HttpContext.Current);
switch (curTheme.Theme)
{
case Ext.Net.Theme.Triton:
case Ext.Net.Theme.CrispTouch:
FormPanel1.Width = 270;
FormPanel1.Height = 234;
break;
case Ext.Net.Theme.Gray:
case Ext.Net.Theme.Default:
FormPanel1.Width = 223;
FormPanel1.Height = 177;
break;
case Ext.Net.Theme.Crisp:
FormPanel1.Width = 240;
FormPanel1.Height = 188;
break;
case Ext.Net.Theme.Neptune:
case Ext.Net.Theme.Aria:
FormPanel1.Width = 245;
FormPanel1.Height = 195;
break;
case Ext.Net.Theme.NeptuneTouch:
FormPanel1.Width = 275;
FormPanel1.Height = 242;
break;
default:
// If ever any other theme take place, then use the biggest of the values above
FormPanel1.Width = 275;
FormPanel1.Height = 242;
break;
}
}
</script>
<html>
<head runat="server">
<title>Field Note - Ext.NET Examples</title>
Expand All @@ -11,6 +52,11 @@
.red-note {
color: red !important;
}
/* this fixes height issues on fields with notes with Chrome 56 -- github issue #1428 */
.x-form-item-body {
height: initial
}
</style>
</head>
<body>
Expand All @@ -31,7 +77,7 @@

<h2>4. FormPanel with notes</h2>

<ext:FormPanel runat="server" BodyPadding="5" Width="270" Height="180">
<ext:FormPanel ID="FormPanel1" runat="server" BodyPadding="5" Frame="true">
<FieldDefaults LabelWidth="50" />
<Items>
<ext:TextField runat="server" FieldLabel="Field1" Note="Description" />
Expand Down

0 comments on commit 31db645

Please sign in to comment.