Forums

Home » Alloy UI » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Lee Chamberlain
Autofields - iteration number
December 7, 2016 5:40 AM
Answer

Lee Chamberlain

Rank: Junior Member

Posts: 72

Join Date: May 5, 2016

Recent Posts

When I'm using Autofields is there an easy way to get which iteration of the field is? (IE a #3 for the third clone of the form fields I'm duplicating).

I need to perform a calculation (with jquery) on some of the fields, but can only perform it on the original fields at the moment.

Thanks
Lee
Byrån Zaugg
RE: Autofields - iteration number
December 20, 2016 12:12 PM
Answer

Byrån Zaugg

LIFERAY STAFF

Rank: Regular Member

Posts: 212

Join Date: April 5, 2012

Recent Posts

I don't believe this is supported out-of-the-box.

You might be able to get something from the private property _guid, as it increments as you add rows. Not sure about that though.

You could also extent AutoFields, with your own component, and override the method addRow(), to add some count reference. But this may get messy, because you also may need to code for removeRow(), and sortable rows.
Byrån Zaugg
RE: Autofields - iteration number
December 20, 2016 12:14 PM
Answer

Byrån Zaugg

LIFERAY STAFF

Rank: Regular Member

Posts: 212

Join Date: April 5, 2012

Recent Posts

Here's the source for reference. auto_fields.js
Lee Chamberlain
RE: Autofields - iteration number
January 9, 2017 6:29 AM
Answer

Lee Chamberlain

Rank: Junior Member

Posts: 72

Join Date: May 5, 2016

Recent Posts

Thanks

I'm also now having problems with datepickers in the autofileds.

I'm using liferay-ui:input-date but whenever I try to use the datepicker in the automatically generated field I'm not able to, and it just remains set as mm/dd/yyyy

Is this a known issue too?

Lee
Byrån Zaugg
RE: Autofields - iteration number
January 11, 2017 4:13 PM
Answer

Byrån Zaugg

LIFERAY STAFF

Rank: Regular Member

Posts: 212

Join Date: April 5, 2012

Recent Posts

That sounds like a bug.

Could you file a ticket with detailed reproduction steps?
Lee Chamberlain
RE: Autofields - iteration number
January 12, 2017 1:17 AM
Answer

Lee Chamberlain

Rank: Junior Member

Posts: 72

Join Date: May 5, 2016

Recent Posts

Byrån Zaugg:
That sounds like a bug.

Could you file a ticket with detailed reproduction steps?



Unfortunately I don't have an account to raise such an issue.
Byrån Zaugg
RE: Autofields - iteration number
January 12, 2017 9:32 AM
Answer

Byrån Zaugg

LIFERAY STAFF

Rank: Regular Member

Posts: 212

Join Date: April 5, 2012

Recent Posts

Please write detailed replication steps, with code examples if necessary, here than. I'll create the ticket and share the link here.

FYI, if you sign-up for a Jira account, you'll be able to track the progress of the ticket easily.