JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Buttons › Button design speed
Tagged: buttons
- This topic has 11 replies, 2 voices, and was last updated 1 week, 1 day ago by tbettinazzi@axioma.it.
-
AuthorPosts
-
November 4, 2024 at 1:36 pm #111703tbettinazzi@axioma.itParticipant
I’ve a huge page in wich are drawn more or less 350 buttons.
Many buttons are identical (changes only the action thei execute).
Using standard html button the drawing is immediate (more or less) using smart-button it takes more than 10 secs.
Is there a way to speed up such drawing process ?
Tks.
Tullio
- This topic was modified 1 week, 3 days ago by tbettinazzi@axioma.it.
November 4, 2024 at 4:09 pm #111707adminKeymasterHi Tulio,
Not, sure what you do, but when you add these at once, it requires just 1 render and executes immediately. See https://codepen.io/jqwidgets/pen/PoMBdWr
Regards,
MarkovSmart UI team
https://www.htmlelements.com/November 5, 2024 at 4:29 pm #111722tbettinazzi@axioma.itParticipantI sent you a testcase reproducing the slowness.
Tks
Tullio
November 5, 2024 at 4:47 pm #111723adminKeymasterHi Tulio,
You can look at the sample I sent you for the correct way to add 350 or more.
Regards,
MarkovSmart UI team
https://www.htmlelements.com/November 5, 2024 at 5:50 pm #111724tbettinazzi@axioma.itParticipantIn your example You used code, I need to use tags.
I don’t know if this is the difference.
Tks
November 6, 2024 at 7:52 am #111726adminKeymasterHi Tulio,
Yes, it is. You can read more about it here https://developer.mozilla.org/en-US/docs/Web/API/Document/createDocumentFragment
Regards,
MarkovSmart UI team
https://www.htmlelements.com/November 6, 2024 at 9:29 am #111729tbettinazzi@axioma.itParticipantTks but this doesn’t solve my problem.
My buttons are distributed among many others html objects and then I believe I can’t create a document fragment, add all buttons and then attach the document fragment.
Could You suggest a viable workaround ?
Furthermore the link You posted tells documentFragment have better performances on “older engines” but I’m using last versions of chrome and firefox.
Tks
Tullio
November 6, 2024 at 9:34 am #111730adminKeymasterHi Tullio,
This is a common way to add a lot of content to a web page. This is the solution. There is not another.
Regards,
MarkovSmart UI team
https://www.htmlelements.com/November 6, 2024 at 9:58 am #111734tbettinazzi@axioma.itParticipantYes but I can’t, if I understand right your soulution.
As explained my button are mixed with other html object (like text, icons etc…) within an html table.
I don’t understand how I can add them at the beginning and then dispose them in the correct position.
If You look at the provided testcase You’ll see the real situation I should work in.
Tks
November 6, 2024 at 12:20 pm #111735adminKeymasterHi,
Even without the document fragment it loads very fast – https://codepen.io/jqwidgets/pen/PoMBdWr. I would suggest you to use dev tools or other dev utilities to measure what slows down your app.
Regards,
MarkovSmart UI team
https://www.htmlelements.com/November 6, 2024 at 1:43 pm #111736tbettinazzi@axioma.itParticipantIn the code You posted buttons are still built by code and not by tags.
I used firefox performance and I saw all “slowness” is in Your code : I’ve only a very smalljs in my code.
Tks
November 6, 2024 at 1:48 pm #111737tbettinazzi@axioma.itParticipantIf usefull I can try to provide the firefox profiler infos.
-
AuthorPosts
- You must be logged in to reply to this topic.