PDA

View Full Version : [CLOSED] TagField MaxHeight



pgodwin
Jun 26, 2015, 2:49 AM
Hi there

The TagField control doesn't appear to respect the MaxHeight property. For example, if I write a method to add 100 tags to a field through the addTag method, the field continues to grow beyond the value set in MaxHeight.

I have also tried setting GrowMax to the same value, with no luck.

I can produce an example if required. I'm on Ext.Net 2.5.2.10697.

Dimitris
Jun 26, 2015, 1:43 PM
Hello,

You probably refer to something like:



<%@ Page Language="C#" AutoEventWireup="true" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script>
var addTags = function () {
for (var i = 0; i < 100; i++)
App.TagField1.addTag(i);
}
</script>
</head>
<body>
<ext:ResourceManager runat="server" />

<ext:TagField
runat="server"
ID="TagField1"
Width="200"
MaxHeight="200"
HideTrigger="true"
Editable="false">
</ext:TagField>

<ext:Button runat="server" Text="Add" >
<Listeners>
<Click Fn="addTags" />
</Listeners>
</ext:Button>
</body>
</html>


I am not quite sure how it should behave, though. It is basically a Combobox; How would you expect it to render?

pgodwin
Jun 26, 2015, 10:41 PM
That example is spot on. What I was hoping to do was enable AutoScroll and have the field grow up to its maximum height and scroll the overflow.

Dimitris
Jun 27, 2015, 4:41 PM
What about using a container, for example:



<%@ Page Language="C#" AutoEventWireup="true" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script>
var addTags = function () {
for (var i = 0; i < 100; i++)
App.TagField1.addTag(i);
}

</script>
</head>
<body>
<ext:ResourceManager runat="server" />

<ext:FieldContainer
runat="server"
Width="200"
Height="200"
AutoScroll="true">
<Items>
<ext:TagField
runat="server"
ID="TagField1"
Width="180"
HideTrigger="true"
Editable="false">
</ext:TagField>
</Items>
</ext:FieldContainer>

<ext:Button runat="server" Text="Add" >
<Listeners>
<Click Fn="addTags" />
</Listeners>
</ext:Button>
</body>
</html>

pgodwin
Jun 29, 2015, 11:24 PM
I hadn't thought of that. Good idea! Can I hide the border of the TagField?

Daniil
Jun 30, 2015, 1:54 PM
I think it should be possible via CSS. You can set a TagField's .Cls property and define a CSS rule to get rid of the border.