PDA

View Full Version : Replace html buttons with Ext buttons



dcollis
25 Jan 2008, 9:23 AM
I am building an ASP.NET application that uses Ext. Because of this we are using asp controls on the page rather than the nicely styled Ext ones.
At times we are using the applyTo/transform properties of the Ext form controls to transform the asp.net ones into nicer looking ones. This is great for everything apart from a button (where applyTo does not work on an input button).

Preferably, I would like to make the asp.net buttons look a little like the Ext toolbar buttons. Anyone have any suggestions?

(This is the kind of code I am using at the moment to style asp.net fields, all I have to do then is add cssClass="exttextfield" to any asp text control that I want changed - I do a similar thing for other field types).


var textFields = Ext.query('.exttextfield');
Ext.each(textFields,function(textField){
new Ext.form.TextField({
applyTo: textField
});
}

robw
25 Jan 2008, 9:32 AM
Apparently this isn't straight-forward.

http://extjs.com/forum/showthread.php?t=24235

danp
8 Feb 2008, 10:19 AM
I ran into the exact same issue yesterday. I am a new to .NET (but working with very knowledgeable people) We have simply created an ext:TextField that inherits from asp:TextField and has a post render hook to instantiate a new Ext.form.TextField object onto it.

As the original poster stated, this does not work for Ext.Button which is a major issue.

I'd love to see a well-written plugin/extension of Ext.Button which can solve this problem.