innocon Posted October 3, 2013 Posted October 3, 2013 Hi, I created a unibutton on the fly, this works fine. BUT: I like to change the style by using css with ClientEvents.ExtEvents.Add, this doesn't seem to show any difference. The button inherits the settings from x-btn instead Any clues? ps: applying ClientEvents.ExtEvents.Add to unibutton which is created at design time does work! procedure TMainFormV2.UniFormShow(Sender: TObject); var st:string; nwbtn:TUniButton; Begin st:='OnBeforerender=function OnBeforerender(sender) '+ ' {'+ 'sender.cls="btngray";'+ 'sender.overCls="btngray-over";'+ 'sender.textAlign=''left'';'+ '}'; nwbtn:=TUniButton.Create(MainFormV2); nwbtn.Parent:=MainFormV2; nwbtn.Top:=10; nwbtn.left:=15; nwbtn.Width:=170; nwbtn.Height:=20; nwbtn.Caption:='Press here'; nwbtn.Cursor:=crHandPoint; nwbtn.OnClick:=SelectionClick; nwbtn.ClientEvents.ExtEvents.Add(st); end; Quote
rullomare Posted October 4, 2013 Posted October 4, 2013 Hi, maybe you can help: In ExtJS 4.x, an 'x-' is appended to the start of the overCls name. For example, if I use overCls: 'btnover' the actual class applied is 'x-btnover' Regards, 1 Quote
Sherzod Posted October 4, 2013 Posted October 4, 2013 Hi JRV. Solution for "left" ... uses ... UniGUIApplication ... UniSession.AddJS('document.getElementById("'+nwbtn.JSName+'_id-btnEl").className = "x-btn-left";'); nwbtn:=TUniButton.Create(MainFormV2); nwbtn.Parent:=MainFormV2; nwbtn.Top:=10; nwbtn.left:=15; nwbtn.Width:=170; nwbtn.Height:=20; nwbtn.Caption:='Press here'; nwbtn.Cursor:=crHandPoint; nwbtn.OnClick:=SelectionClick; UniSession.AddJS('document.getElementById("'+nwbtn.JSName+'_id-btnEl").className = "x-btn-left";'); Sincerely. 1 Quote
Sherzod Posted October 4, 2013 Posted October 4, 2013 for overCls UniSession.AddJS(nwbtn.JSName+'.overCls = "btngray-over";'); 1 1 Quote
Administrators Farshad Mohajeri Posted February 13, 2014 Administrators Posted February 13, 2014 not a bug report. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.