PDA

View Full Version : [CLOSED] Problem With TaskManager's Update.Handler and Image



matrixwebtech
Nov 26, 2014, 3:08 PM
Test View

@{
//Layout = "~/Views/Shared/_Layout.cshtml";
var X = Html.X();


}
@X.ResourceManager()
@(
Html.X().Viewport()
.Layout(LayoutType.Border)
.Border(false)
.Items(

X.Panel().Layout(LayoutType.HBox)

.BodyStyle("background: #DFE8F6").AutoScroll(false)
.Items
(
X.Image()
.ImageUrl("http://octagonerp.com/FileRepository/Admin/AdminSettings/CompanyInformation/Image/BaanyanSoftwareServices.jpg")
@*http://4.bp.blogspot.com/-JOqxgp-ZWe0/U3BtyEQlEiI/AAAAAAAAOfg/Doq6Q2MwIKA/s1600/google-logo-874x288.png*@
.Height(40)
.Width(300)
)

,
X.Panel().ID("pbottom")

.BodyPadding(0)
.AutoScroll(false)

.Region(Region.South)
//.BottomBarItem(

// )
.BottomBar(
X.StatusBar().StatusAlign(StatusAlign.Right).Borde r(false)
.Items(

X.ToolbarTextItem().Text(System.DateTime.Now.ToStr ing("dd-MM-yyyy")),
X.ToolbarTextItem().ID("txttime")
)
).AlignTo("pbottom", "Left")
)
)

@(X.TaskManager()
.Tasks(
X.Task()
.Interval(1000)
.Listeners(l => {

l.Update.Handler = "App.txttime.setText(Ext.Date.format(new Date(), 'H:i:s'));";

})
))

Please run above code ,and you will find the Image (at Top Left) jerk on every interval of TaskManager's Update.Handler.please help me to fix this.the jerk of this image is not looking good.
but if comment
l.Update.Handler = "App.txttime.setText(Ext.Date.format(new Date(), 'H:i:s'));"; image mot jerking.
you can see this also here (http://octagonerp.com/login)
user name and password :-bsspl

Daniil
Nov 27, 2014, 2:41 PM
Hi @matrixwebtech,


you can see this also here (http://octagonerp.com/login)
user name and password :-bsspl

I cannot see anything wrong with the image. Please clarify is it still reproducible on you side?

matrixwebtech
Nov 27, 2014, 2:55 PM
Hi daniil ,thanks for investigate.It still happen.better you run the test example which I provide on your side ,I use Firefox (33.1.1) ,and please put eyes on the image you see the image jerk .
I think you test in Chrome,I also check in Chrome and every thing is fine.please test it in Firefox (33.1.1) once.

Daniil
Nov 28, 2014, 2:41 PM
I tried with the test case in Firefox 33.1.1. I don't see the image moves or something.

Could you, please, provide a screencast? Maybe, it would clarify something.

matrixwebtech
Nov 28, 2014, 4:26 PM
Hi danill,
please observe the Image in video
http://www.screencast.com/users/matrixwebtech/folders/Default/media/332bb670-d926-466a-bff3-031ba1f98197

Vladimir
Nov 28, 2014, 6:20 PM
I cannot reproduce such behaviour also.

matrixwebtech
Nov 28, 2014, 6:30 PM
Vladimir
Thanks for investigate ,its very unfortunate .I try with chrome then its ok.but problem in firefox.are you watch the screencast?will I send the media file via dropbox?may be it will help?

Vladimir
Nov 28, 2014, 6:47 PM
I updated my Firefox and was able to reproduce the issue
I guess the problem is not related with TaskManager and Ext.Net
The problem that you set strange width and height which set another aspect ratio for your image

Original image has 200 width and 100 height. So, aspect ratio 2:1
You set 300 width and and 40 height. Aspect ratio 7.5 : 1

If you set another size then you will see that the issue is resolved. Or you need to change your original image size (physical image, not Image control)

matrixwebtech
Nov 28, 2014, 6:59 PM
Got your point.but then why its fine with chrome,and image not jerking(Firefox 33.1.1) if taskmanagre's update handlar is removed?

Vladimir
Nov 28, 2014, 7:10 PM
why its fine with chrome

I guess that Chrome correctly handles such custom aspect ratio



and image not jerking(Firefox 33.1.1) if taskmanagre's update handlar is removed?

I guess that setText causes relayouting (and DOM update) and FF redraw the image differently each time due custom aspect ratio. So, i think it is Firefox bug

If you replace task manager handler by this code then it should help


App.txttime.el.update(Ext.Date.format(new Date(), 'H:i:s'));


Best way, to change image size (file image size) and use the same image size in your application

matrixwebtech
Nov 28, 2014, 7:27 PM
Thanks for quick reply.I use

App.txttime.el.update(Ext.Date.format(new Date(), 'H:i:s'));

and image not jerking,but one another issue has come.if you run the sample with
App.txttime.el.update(Ext.Date.format(new Date(), 'H:i:s'));see time not visible properly status bar.

Daniil
Nov 30, 2014, 10:57 PM
see time not visible properly status bar.

Could you, please, share any details? What would you expect and how it is actually?


Best way, to change image size (file image size) and use the same image size in your application

Please clarify have you tried it?

matrixwebtech
Dec 01, 2014, 6:15 AM
Hi Daniil
As per valadimir's suggestion
If you set another size then you will see that the issue is resolved. Or you need to change your original image size (physical image, not Image control) all works fine,and I also think this is right way to do this,and this I can be done when upload a image we can restrict size.but some times user don't have image with correct size and even they don't have an image formatting tool or any experience .so if its not possible to set Image control's height and width,then leave it I will force user to upload correct image.

Daniil
Dec 03, 2014, 3:27 PM
I would recommend to resize and/or scale an image programmatically on server.

matrixwebtech
Dec 03, 2014, 4:13 PM
i am also thinking about this.please close.