PDA

View Full Version : [CLOSED] Change custom icon to trigger of ComboBox



osef
Jul 25, 2013, 4:04 AM
Hi Team Ext.Net I Want to change the icon to trigger of ComboBox, I see the property "TriggerCls", but I don't see anything efect, How Can I to do it?

Regards.

Daniil
Jul 25, 2013, 5:27 AM
Hi @osef,

Here is an example.

Example

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

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>

<style>
.my-icon {
background-image: url(resources/images/test.png);
}
</style>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:ComboBox runat="server" TriggerCls="my-icon" />
</form>
</body>
</html>

osef
Jul 25, 2013, 5:38 AM
Hi @osef,

Here is an example.

Example

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

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>

<style>
.my-icon {
background-image: url(resources/images/test.png);
}
</style>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:ComboBox runat="server" TriggerCls="my-icon" />
</form>
</body>
</html>


Hi Daniil, I have a page in white, when I put this code.

Daniil
Jul 25, 2013, 5:40 AM
What Ext.NET version are you using?

osef
Jul 25, 2013, 2:26 PM
What Ext.NET version are you using?

I'm using Ext.Net 2.0

Vladimir
Jul 25, 2013, 2:33 PM
Please see the following sample
http://examples2.ext.net/#/Form/TriggerField/Custom_Icon/

Please note that image for trigger is complex (it should contain 5 states for button), here is an example for button
http://examples2.ext.net/Examples/Form/TriggerField/Custom_Icon/resources/images/custom-trigger.gif
http://examples2.ext.net/Examples/Form/TriggerField/Custom_Icon/resources/images/custom-trigger.gif

osef
Jul 25, 2013, 3:04 PM
Please see the following sample
http://examples2.ext.net/#/Form/TriggerField/Custom_Icon/

Please note that image for trigger is complex (it should contain 5 states for button), here is an example for button
http://examples2.ext.net/Examples/Form/TriggerField/Custom_Icon/resources/images/custom-trigger.gif
http://examples2.ext.net/Examples/Form/TriggerField/Custom_Icon/resources/images/custom-trigger.gif

Vladimir I need the control ComboBox has this trigger, in the example is the control TriggerField, thank you.

Baidaly
Jul 26, 2013, 3:30 AM
Hello!

Try the following:



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

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>

<style>
.my-icon {
background-image: url(http://examples2.ext.net/Examples/Form/TriggerField/Custom_Icon/resources/images/custom-trigger.gif);
}
</style>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:ComboBox runat="server" TriggerCls="my-icon" />
</form>
</body>
</html>

osef
Jul 26, 2013, 7:33 PM
Hello!

Try the following:



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

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>

<style>
.my-icon {
background-image: url(http://examples2.ext.net/Examples/Form/TriggerField/Custom_Icon/resources/images/custom-trigger.gif);
}
</style>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:ComboBox runat="server" TriggerCls="my-icon" />
</form>
</body>
</html>


Hi Baidaly

I keep seeing a white page withi this code, thank you.

Regards

Baidaly
Jul 26, 2013, 7:57 PM
It seems Ext.NET 2.0 has the bug, so you wrap TirggerCls value by quotes. Use the following:



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

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>

<style>
.my-icon {
background-image: url(http://examples2.ext.net/Examples/Form/TriggerField/Custom_Icon/resources/images/custom-trigger.gif);
}
</style>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:ComboBox runat="server" TriggerCls="'my-icon'" />
</form>
</body>
</html>

osef
Jul 26, 2013, 9:19 PM
It seems Ext.NET 2.0 has the bug, so you wrap TirggerCls value by quotes. Use the following:



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

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>

<style>
.my-icon {
background-image: url(http://examples2.ext.net/Examples/Form/TriggerField/Custom_Icon/resources/images/custom-trigger.gif);
}
</style>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:ComboBox runat="server" TriggerCls="'my-icon'" />
</form>
</body>
</html>


Baidaly, This is working thank you. You can to close this thred.