dhtmlx Touch List with counterButton

Hi,

i have a list that is bound to a dataview, that is, when u click an item on the dataview, it loads list items.

Now the each list has a counteButton, and there is a Total button that gets the total counters.

The problem is , when u move to a different Dataview itm, and get the Total, the conter begins.

Please Help

Hi,

Probably you are working on app that is similar to our demo app. There is no such a problem. So, you may learn this example and possibly it will help to solve the issue:

dhtmlx.com/touch/samples/apps/menu/index.html

If you are using different approach, please provide more details about the problem.

Thx for the Reply,

Yes i have seen the app and have been using it, but on the App they are not using a counterButton like in here http://www.dhtmlx.com/touch/samples/04_list/10_active_complex.html

They are using a DIV, it’s like they have created their own Counter. is it possible to have a counter button possible and achieve same results.

Please Help

When you change value of counter button, this value is kept in list datastore. However, if you reload list data, all list item are replaced with data from data source you load. So, please check whether data that you load contains correct count values.

If the problem can not be solved, you can attach a demo that reproduces it.

Find Attached my Project.

I have not Uploaded the TouchLibraries bcoz they are large.

Thx in advance
touch.rar (323 KB)

Ok,then.

How can i know, which button has been clicked on the counter?

If its either a Minus or a PLus

Hello,

There was incorrect setTotal method in your app. The sum was started with 0 value and only filtered items were calculated.
But, in my opinion, you will need more information about ordered items in order app: at least item id and ordered count. We have modified your ts_main.js and add DataCollection to store ordered items (changed counterClick and setTotal methods). Each time you click on “counter” button, order collection is updated (an item is added, updated with new count or removed).
ts_main.zip (2.76 KB)

Thx so mmuch, beeen waiting for this

Hi,

How can i refresh my counter to zero after i finish entering a sale?

Hi,

You can set 0 as counterButton properties for ordered item in list, and refresh these items:

orderedItems.data.each(function(item){
var id = item.id;
$$(“products”).item(id).counterButton = 0;
$$(“products”).refresh(id);
})

Works persfectly :slight_smile: Thx