语言

Menu
Sites
Language
How to refresh my genlist?

Hello,

I made a genlist and a refresh button,

and I want to refresh my genlist when I clicked the refresh button.

How can I do it? Help me!

Thanks!

响应

8 回复
Alex Dem

Hi,
I suppose that you should use:

    elm_genlist_realized_items_update  (obj);

to update the content of all realized items in list. All CBs functions will be  called again to get the content, text and states.
Alexey.

Changhoon Lee

I solved this problem, 

by using elm_genlist_clear() and reload all items.

thank you :)

Carsten Haitzler

why refresh the list though? if a specific item has updated (the data backing it has) then just update that item. do it for any items that update whenever needed.

Changhoon Lee

when I create a item, it does not go into genlist directly, but go into my database first.

and my genlist gets updated items from the database.

so... I thought that it needs refresh button,

but now solved!!

thank you :)

Palitsyna

Hello,

here you can find more information about genlist, hope it will be helpful:

https://developer.tizen.org/dev-guide/2.3.0/org.tizen.native.mobile.apireference/group__Genlist.html

Regards,

Svetlana Palitsyna

Jean Yang

Hi, 

Good example is in IDE sample, create UI controls demo, then find the genlist in it. Maybe that will be helpful to understand genlist.

Vikram

update the whole genlist will cause performance issue if it has very much items, especially the item has icon image.

a better way is just to update the specific item if needed.

such as:

Elm_Object_Item *it = elm_genlist_nth_item_get(genlistObj, 2);
elm_genlist_item_fields_update(it, "elm.swallow.icon", ELM_GENLIST_ITEM_FIELD_CONTENT);

 

Carsten Haitzler

vikram is totally right - just update the items that need updating. if you really want then only update items that have been realized.