Settings a Displayfield value a second time tooks quite to long - extjs

Can anyone tell me way the second time I am setting the value of a displayfield it took ExtJS arround ~300ms per field to set the value? I already tried to use setRawValue() instead of setValue() but it is all the same. A simple profiling shows that the time is consumed by the following lines:
me.inputEl.dom.innerHTML = me.getDisplayValue();
me.updateLayout();
Edit:
A further Prifiling shows that me.updateLayout(); took all the time.
Any Idea how I can speed this up? I tested it with ExtJS 4.1.3

You can improve performance by using Ext.suspendLayouts() before you start setting the fields. Once you've set all your fields, use Ext.resumeLayouts(true)

Related

Wait for the options to be filled in dropdown Jmeter

I am doing Selenium Testing using Jmeter Script. I want to select a value in dropdown but it takes a few seconds after the page loads for all the options to fill in the dropdown. I want to wait until those options are filled.
I tried below methods but they don't seem to work:
var waitPropHist = new org.openqa.selenium.support.ui.WebDriverWait(WDS.browser, 20);
Thought using above, I can just put a delay in my testing but that didnt seem to work.
Could anyone please guide me on this? I want to either put a delay in script or just wait until the dropdown size increases.
This line doesn't do anything per se, you need to call wait.until() function and provide either one of the ExpectedConditions or your custom condition implementation.
Example:
var wait = new org.openqa.selenium.support.ui.WebDriverWait(WDS.browser, 25)
wait.until(org.openqa.selenium.support.ui.ExpectedConditions.elementToBeClickable(org.openqa.selenium.By.xpath("//a[contains(text(),'More information')]")))
More information: The WebDriver Sampler: Your Top 10 Questions Answered

Set default date for zul datebox

I inherited a legacy website written in old zul and have to add new datebox component for birthday datepicker.
Have added a constraint to accept dates before a given date but that triggers an error alertbox from start as the date presented/selected by default on the datepicker is today.
I wouldn't want to use a workaround but to all due respect it seems like this is something over the top feature I'm looking for in zk's reality:
The main showcase for zul does include a birthday datebox, but pretty lame as it doesn't contain any constrain on age.
There is zk fiddler to show how the before constrain works, but that just proves my point that it doesn't select the first proper date for default date at least, if there is no clean way of setting it.
There is forum post that proposes a workaround to set the default year, so Zk is most probably incapable of doing this without a workaround.
There is an open ZK Jira issue from 2017 that addresses somewhat this issue, with a proposed solution pretty much the same as the workaround mentioned in the above point - so the hope is kinda lost, have to go on the workaround route.
I did try that workaround (after the forum post, as that has default year), but the workaround doesn't work for me. It does execute the
this.setValue(initialDate);
And I see that the value is set into the datebox's _pop/_value and _pop/_end nodes but no difference is visible on the datepicker box, still today is preselected altough it is greyed out - so no effect.
Still, when I try it in a fiddle with version 6.5.8.1, the oldest engine that exists, it does work, but not locally with v5.0.11.
In the buglist for this version there is no mention of datebox. Tried to look into to some bugs that might be interfering but turns out it was just another episode of me wasting time with this.
Tried in the 5.0.11 sandbox and it doesnt work with that version. The structure of how I use it is imitated in the linked fiddler. Hints on a workaround that works on this version?
ZK 5.0.11 is a bit on the older side currently, so it might not accept exactly the same overrides as later versions. If I understand the issue correctly, it boils down to either
1 - setting a value before Datebox is rendered to have a "initial date" opened in calendar.
I'd say that's the easy way out, since you can use either composing or databinding to set the value of the datebox during page rendering. Here's a small sample using databinding and zscripts, but the same logic should apply from composer with setValue(). You mentioned that this doesn't work for you locally with 5.0.11 though. Can you share the code that you are using for this? Sample code here in fiddle I can run it on local 5.0.11, and it set the date before popup is opened.
or
2 - setting an initial date (which doesn't affect the selected value) but would be the target for the opened calendar.
This is not a default ZK 5 behavior for datebox. If you want that effect, you would need to customize it using an override script. Simplest way in can think of in ZK 5 is to use the open event of the datebox popup here's an example of what it would look like (package in a script tag in a single page for the example, would use a global js file for real deployement) example here

DHTMLXGantt with ReactJS setting work_time

I am trying to use DHTMLXGantt on my reactJs project, and I have gone through their tutorial when setting it up. Now I want to modify it to only consider the working hours by adding gantt.config.work_time = true which seems pretty straightforward.
However, when I add it, it still doesn't display only the work time (08hr - 17hr), rather shows hours from 00hr - 23hr on the gantt as below:
Would really appreciate if anyone has tried a similar thing and got it working. Thanks a lot.
Enabling worktime won't automatically change the time scale,
you'll need to hide columns using gantt.ignore_time function
gantt.ignore_time = function(date){
if(!gantt.isWorkTime(date))
return true;
};

uiBootstrap timepicker stays one hour behind

I am using ui-bootstrap timepicker and the time on the scope variable is always one hour behind the time that is displayed on the picker. what is causing it and how can I get rid of it. I need to store the correct time not the time thats one hour behind.
For example when the time on time-picker is :
16 : 12
i get to see on console:
Time is: "2016-05-26T15:12:34.403Z"
I followed very basic code for the ui-bootstrap timepicker. Can anyone explain how can I store the correct time in my variable.
Thanks in Advance.

Extjs 4: Time Stacked Bar Chart, possible?

Hi I'm trying to accomplish a time stacked bar chart where the input data looks like this:
{"name":"Folienwechsel",
"starttime":"02/29/2012 09:50:07",
"endtime":"02/29/2012 09:50:46",
"duration":38546.0},
{"name":"Pause",
"starttime":"02/29/2012 09:50:46",
"endtime":"02/29/2012 09:51:36",
"duration":49943.0},
{"name":"Wartezeiten",
"starttime":"02/29/2012 09:51:36",
"endtime":"02/29/2012 10:04:43",
"duration":787086.0}
As you see the start time and end time are continued, when a state finish the other one starts, I've been trying with the timeaxis, based on this tutorial http://aboutfrontend.com/extjs/extjs...-and-timeaxis/, and also with the stackbar example in sencha http://docs.sencha.com/ext-js/4-0/#!...tackedBar.html. An image example of what I'm trying to do:
I already done this with HighChart, but my company has bought ExtJs then I need to do this with Extjs, then it would be great if someone can tell me if its possible, and if it is, then if could guide me with an example or how should I start...
Thanks.
I spent some time working with time based charts in ExtJs4 and I have to warn you - that TimeAxis is buggy. I even had to replace my time axes with simple numeric ones. The idea is simple - convert your dates into the timestamps and pass them to your numeric axis.
Stackbar chart is a good choice for you. See this example (modified a bit), from official sencha examples:
http://jsfiddle.net/UDwz7/

Resources