JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › General Discussions › my app issue
- This topic has 15 replies, 3 voices, and was last updated 2 years ago by svetoslav_borislavov.
-
AuthorPosts
-
October 13, 2022 at 11:29 am #103861tbettinazzi@axioma.itParticipant
In my application I’ve pages with a lot of elements.
When the page is shown it seems to freeze for a second or two before the content is completely usable and correctly formatted.
I tested with last versions of Chrome and Firefox.
My client is a quite powerfull system.
How can I improuve the user experience.
Tks
October 13, 2022 at 3:59 pm #103864adminKeymasterHi,
One common approach is to initialize elements on demand when they are necessary. I do not know what your application is, but for example, if you have tabs, initialize the elements which are inside the tabs when the tab is clicked. Similar approach can be applied if you use Accordion.
Hope this information helps.
Best regards,
Peter StoevSmart UI Team
https://www.htmlelements.com/October 20, 2022 at 4:16 pm #103894tbettinazzi@axioma.itParticipantTabs are not the main cause of the performance problem.
One, but not the only, problem seems to come out from dropdown lists having a lot of list-items.
I’ve a page with only one dropdown list in it with many (more than 100) list items : the page seems to freeze for 2 seconds before it’s shown correctely.
Is there a workaround for that ?
Tks
October 21, 2022 at 11:32 am #103895adminKeymasterHi,
Yes, there is. You can use the dataSource property to set the items instead of creating html element for each item.
Example:
` document.getElementById(‘dropDownListMethodsDemo’).dataSource =
[{
label: “Andrew”,
value: 1,
group: “Product Owners”
},
{
label: “Natalia”,
value: 2,
group: “Developers”
},
{
label: “Michael”,
value: 3,
group: “Developers”
},
{
label: “Angel”,
value: 4,
group: “Product Owners”
},
{
label: “Hristo”,
value: 5,
group: “Developers”
},
{
label: “Peter”,
value: 6,
group: “Developers”
},
{
label: “Albert”,
value: 7,
group: “Support”
},
{
label: “George”,
value: 8,
group: “Support”
}];`Best regards,
Peter StoevSmart UI Team
https://www.htmlelements.com/October 22, 2022 at 6:25 am #103898tbettinazzi@axioma.itParticipantTks for your help, I’ll try as soon as possible.
However I need to add, to each value, a class : is it possible with data-source ?
My classes (e.g. bg-1) are defined in this way
.bg-1 .smart-list-item-container {
background-color: blue
}should I change such definitions ?
Tks
October 24, 2022 at 8:56 am #103904tbettinazzi@axioma.itParticipantAnyway I tested
<smart-drop-down-list filterable=”true” filter-mode=”containsIgnoreCase” id=”e47522256″ min-length=”1″ selectionMode=”zeroOrOne” class=”elemento_combobox_valore” name=”e47522256″ selected-indexes=”[4]” required=”” onchange=”mostraAlertMsgOption(this); eseguiRefresh(this);” onfocus=”on_focus(this)”
data-source=[{label: ‘WAM ROMANIA’, value: ‘AF’}, {label: ‘WAM PRODUCT’, value: ‘AA’}]>
</smart-drop-down-list>And I allways get an error :
expected property name or ‘}’ at line 1 column 3 of the JSON data
What’s wrong ?
Tks
- This reply was modified 2 years ago by tbettinazzi@axioma.it.
October 24, 2022 at 11:30 am #103907svetoslav_borislavovParticipantHi,
Could you, please set the data source programmatically this way: https://codepen.io/svetoslavb04/pen/oNyvPZN
I hope this demo helps! If you need further assistance, do not hesitate to contact us!
Best Regards,
Svetoslav BorislavovSmart UI Team
https://www.htmlelements.com/November 2, 2022 at 2:51 pm #103942tbettinazzi@axioma.itParticipantTested Your suggestion which improves the result from more thn 2 secs to 1.5 secs.
However is still quite long time when I’ve more than a dropdown list in my page.
Is there any way to improve further the performances ?
Tks
November 2, 2022 at 3:07 pm #103943svetoslav_borislavovParticipantHi,
Could you, please import only the necessary elements?
For example: ‘smart-webcomponents/source/modules/smart.dropdownlist.js’I am looking forward to hearing from you!
Best Regards,
Svetoslav BorislavovSmart UI Team
https://www.htmlelements.com/November 2, 2022 at 3:16 pm #103944tbettinazzi@axioma.itParticipantUnfortunately I can’t because my page is generated at runtime and I don’t know which kind of elements are in that page.
Anyway I did it in a simple testcase I created and it doesn’t change the page building time.
On the other hand the js file are cached and the loading time of the js doesn’t seem to be a problem.
Tks
November 4, 2022 at 10:01 am #103967tbettinazzi@axioma.itParticipantI created a testcase to reproduce the problem.
Is quite huge because I copied it from my real world.
Please provide me a way to send You the code.
Not all the code is needed but if I can’t clean up the unneeded parts.
The examples shows that the page buid up time is quite long (6 seconds) and it depends entierely from a large dropdown list.
Please suggest a solution to improve significantely the response time.
Tks
- This reply was modified 2 years ago by tbettinazzi@axioma.it.
November 4, 2022 at 1:11 pm #103969svetoslav_borislavovParticipantHi,
You can send it here svetoslav@jqwidgets.com
Best Regards,
Svetoslav BorislavovSmart UI Team
https://www.htmlelements.com/November 4, 2022 at 5:44 pm #103973tbettinazzi@axioma.itParticipantSent.
Tks
November 7, 2022 at 4:30 pm #103977svetoslav_borislavovParticipantHi,
I received your example. I have modified it a little bit.
Since loading data with the property ‘ virtualized’ of the list box significantly increases the performance I have implemented a drop-down list with the combination of a drop-down button and a list box. Also, I have applied some CSS as you can see in the ‘elementi.css’.
You can download a copy of the modified version from here: https://easyupload.io/0eeudv
See how a managed to do the drop-down list and you can implement it with every drop-down list which has got many data.Please use this method only when you have got many data. For a drop-down with a few list items use the default drop-down list.
See ‘elementi.css’, ‘index.html’, ‘combobox.js’
I hope this helps!
Best Regards,
Svetoslav BorislavovSmart UI Team
https://www.htmlelements.com/November 8, 2022 at 9:16 am #103978tbettinazzi@axioma.itParticipantTks for your help.
Just a few questions :
- also DropDownList has a virtualized property, why did You suggest ListBox in spite of DropDownList ?
- are there drawback using virtualized propery (eg. filter don’t work or any other feature missnig) ?
Tks
Tullio
-
AuthorPosts
- You must be logged in to reply to this topic.