jQWidgets Forums

jQuery UI Widgets Forums General Discussions Widget creation time

This topic contains 2 replies, has 2 voices, and was last updated by  defyent 5 years, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Widget creation time #111786

    defyent
    Participant

    I have a standard html table (not a jqx table) which allows me to dynamically create and destroy rows. Each row consists of 12 jqxwidgets. Some dropdownlists, some number fields, some text fields etc. What I’m noticing is that there is a noticable lag between clicking the button and the row with the widgets being rendered. On my computer it takes just over 1 second, however on slower computers it can take up to 3 or 4 seconds. I imagine this is because I’m creating the widgets on the fly as I click the button. However I did expect this to happen a lot quicker. I’m not doing anything fancy on the button push, simply creating the widgets with new names as soon as the button is clicked, wrapping it in some table html and appending it to the tbody of the table.

    What is the best way for me to troubleshoot / optimize this for quicker render times?

    I’ve uploaded an unlisted video so you can see what I mean. I’ll work on an example so show, but that may be a bit tricky.

    https://www.youtube.com/watch?v=4PF65_BHwIc

    Widget creation time #111789

    admin
    Keymaster

    Hi defyent,

    Adding of HTML Element on a web page causes reflows. If you want to add multiple components, my suggestion is to first append their HTML Elements within a document fragment. When all of the are in the document fragment, append the fragment to the web page and then initialize the components. By doing that, you will minimize the creation time.

    Regards,
    Peter

    Widget creation time #111796

    defyent
    Participant

    Thanks for the quick reply, I believe the time being taken was caused by another issue I’ve had recently where dropdownlists were calling the json source url every time they load, even if they share the same dataadapter. I seem to have sped up the response time by quite a lot by changing the adapter source to dataAdapter.records instead of just the dataAdapter. Hopefully this resolves the issue on slower computers as well.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.