Page 1 of 1

How to duplicate an item while in the same screen?

Posted: Thu Jul 11, 2013 1:09 am
by John Herdean

Hi, I have a few labels in a gridview (for example) that I would like to have the user be able to add as many of those gridviews as they want (basically the user to create a self list, but not necessarilly in a list view). I'm imagining that I would have to write JS for this. If so, what would the JS look like? Or is there another easier way to do this?


How to duplicate an item while in the same screen?

Posted: Thu Jul 11, 2013 2:46 am
by Igor

Hello! Working on it.


How to duplicate an item while in the same screen?

Posted: Thu Jul 11, 2013 6:49 am
by Kateryna Grynko

Hi John,

You should programmatically create new items to get a needed structure. This can be based on template, for example:
precodevar row = ['<tr>',
'<td>',
' <div class="cell-wrapper">',
' <div data-role="appery_label">',
' Label',
' <&#47;div>',
' <&#47;div>',
'<&#47;td>',
'<td>',
' <div class="cell-wrapper">',
' <div data-role="appery_label">',
' Label',
' <&#47;div>',
' <&#47;div>',
'<&#47;td>',
'<&#47;tr>']&#46;join("");

$( row )&#46;appendTo( Appery("your_mobilegrid_component_name")&#46;find("tbody") )&#46;trigger( "create" );/code/pre

Note the absence of CSS-classes for the row and table cells. This may cause a discrepancy in appearance. Add the needed CSS-classes for the rows, cells, and built-in components.

. trigger ("create") - is needed to initialize jQueryMobile components used within the created cells.