Anthony Hyams
Posts: 0
Joined: Tue Apr 01, 2014 10:54 am

List suffixes have gone

Has something changed with the way collapsible lists are named. I was using the following code to store some data and now it doesn't work and on looking at the html for my page the naming of elements seems to have changed.

$butid = this.id;
$butid = $butid.substring(21);
$event = "rpgs_rpgcode" + $butid;
$event = $("#rpgs_rpgcode"+$butid).text();
localStorage.setItem('eventid', $event);
$name = "rpgs_rpgname" + $butid;
$name = $("#rpgs_rpgname"+$butid).text();
localStorage.setItem('eventname', $name);

To explain a collapsible list would be populated from a database. The expanded list would have various bits of information relevant to the list header. Item code, description etc.

When the "add to schedule" button was clicked the script would strip off the name as each record from the database would have its own button name eg rpgs_mobilebutton_29_0 for the first record and rpgs_mobilebutton_29_1 for the second.

Each data item was correspondingly named with the _0 _1 etc.. So to get the item code I just found the code with the correct suffix. Pulled the text and stored in localstorage. Then posted them to the database.

NOW: the suffix is missing , all the buttons are just rpgs_mobilebutton_29 so it fails.

Any ideas

Claudio Cáceres
Posts: 0
Joined: Mon Mar 31, 2014 7:40 pm

List suffixes have gone

I have the same problem to identify my generated Items... Now how i identify your generated SubGrid's elements???

Image

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

List suffixes have gone

Hi Anthony and Claudio -

We research this issue, we will update here.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

List suffixes have gone

Hi All,

Try replace selector by id code$("#name_"+index)/codewith selector by attribute codename: $("[name=componentName]")/code

Anthony Hyams
Posts: 0
Joined: Tue Apr 01, 2014 10:54 am

List suffixes have gone

I don't understand this. I used to have a set of components called id="rpgs_rpgcode_0"
id="rpgs_rpgcode_1"
id="rpgs_rpgcode_2"

now they are all called id="rpgs_rpgcode"

Firstly shouldn't id's be unique on a page? That's the purpose of the id attribute, to uniquely identify an element?

It was there last week - but not now.

Secondly
How does your solution work ? Do I need now to add an attribute to each list or collapsible item on population of the list. which I then reference in my script?

Does appery do this a lot, just change fundamental stuff so I have to recode the whole app just as I was looking to finish it?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

List suffixes have gone

Hi Anthony,

It works for us with different IDs. Please share the application with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a and tell us how to run your service.

Anthony Hyams
Posts: 0
Joined: Tue Apr 01, 2014 10:54 am

List suffixes have gone

application shared.

from the front screen click the wizard icon - on the following screen - click saturday - then expand a result from the list and click the add to schedule button.

At present this won't add anything as you are not logged in. However it is this page which has the issue. If you inspect the "add to schedule" buttons they do not have a suffix that numbers them, they all have the same mobilebutton_29 id.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

List suffixes have gone

Anthony,

Seems to be a bug. To get 'rpgcode' label text run this code on 'Add to Schedule' Click event:prevar rpgcode = $(this).parent().find("[name=rpgcode]").text();/pre

Anthony Hyams
Posts: 0
Joined: Tue Apr 01, 2014 10:54 am

List suffixes have gone

That works.. much more elegant.. I assume that will always work assuming I don't change the component name

Claudio Cáceres
Posts: 0
Joined: Mon Mar 31, 2014 7:40 pm

List suffixes have gone

The solutions do not work for me. That solution select all components with the shared id. Identify and select the element is not the problem. The problem is identifying an element between other elements automatically generated. All have the same ID. Before they had a different ID. Before was....
GRID - Products_1
ProductLabel_1 (Happy face shampoo)
Qty_1 (x10)
Price_1 ($ 40 per shampoo)
Subtotal_1 ($400)
OneMoreButton_1 (If clicked - Qty_1 = 11 & Subtotal_1 = $440)

GRID - Products_2
ProductLabel_2 (Frustrated soup)
Qty_2 (x10)
Price_2 ($ 3.99 per soup)
Subtotal_2 ($39.90)
OneMoreButton_2 (If clicked - Qty_2 = 11 & Subtotal_2 = $43.89)

And now with this "solution" is ...
GRID - Products_1
ProductLabel (Happy face shampoo)
Qty (x10)
Price ($ 40 per shampoo)
Subtotal ($400)
OneMoreButton (If clicked - All Qty = 11 & Subtotal = $440)

GRID - Products_2
ProductLabel (Frustrated soup)
Qty (x10)
Price ($ 3.99 per soup)
Subtotal ($400)
OneMoreButton (If clicked - All Qty = 11 & Subtotal = $440)

I have a GRID with the incremental prefix. The sub-elements are not prefixed. Each sub element has an event when pressed increase the total.

Can you go back to previous version an application?

Return to “Issues”