RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

Using JavaSript to change count in list count property

What is the best way to do this - thank you.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Using JavaSript to change count in list count property

Hello!

Could you clarify your question in more details?

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

Using JavaSript to change count in list count property

Hi Maryna... sure: I have a mobile list called 'boblist' with an item named "messages" which has the counter visible property set to true. I want to set that counter value programmatically. Thanks.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Using JavaSript to change count in list count property

Try this code:
pre$("#start_mobilelistitem_23 span").text('100');/pre
where start_mobilelistitem_23 - id of your list item.

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

Using JavaSript to change count in list count property

Thank you Maryna... but unfortunately it does not seem to work. Do you think it needs some type of refresh?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Using JavaSript to change count in list count property

Hi Robert.

Please try this code:

pre
code

jQuery('[name="messages"]:eq(0) .ui-li-count').text("counter_text")

/code
/pre

Where:

"messages" - is your listitem name. Like you mentioned above.

"eq(0)" - get first item. If you want to get 2nd item, you should to use "eq(1)" and so on.

Also if you have some problem with this code, please provide us details about how did you tryed it. Perhaps screen shots.

Regards.

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

Using JavaSript to change count in list count property

That works perfectly Yurii - thanks a million.

Return to “Issues”