araskin3i
Posts: 0
Joined: Fri Dec 20, 2013 2:44 pm

bind an ID to a button

I am hoping for some 'best practice' guidance.

I am returning an array of objects from a REST service and would like to have those appear inside a grid. Each row (representing an object) has an Edit button. The user clicks on the Edit button if they wish to update the data. I would like to bind in the _id into the button as a custom attribute (data-object-id) so that when the user clicks the button the JS will read the attribute, set a local storage variable and then display the edit screen.

So what I did was bind in the _id into the button.text and then in the transformation JS I read the value and set the custom attribute (data-object-id). The problem is that now the button text has the _id displayed. I tried to override it using codeelement.find(".ui-btn-text").text("new text");/code but it seems that Appery sets the ID AFTER the transformation code executes thereby negating my code above.

Perhaps I am going about this all wrong? Any thoughts/guidance would be greatly appreciated.

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

bind an ID to a button

Hello,

How do you execute your events? I'm not sure if this helps, but you could use event order.
http://docs.appery.io/documentation/w...

Return to “Issues”