Hi,
I'd like to know if there is a way to add a new row to a datable and make this row editable without clicking on the edit button (some kind of javascript call).
Could anyone help me on that?
[SOLVED] Add a new row to a datatable in edit mode
-
- Posts: 24
- Joined: 22 Oct 2010, 20:00
Last edited by daniel.camargo on 23 Nov 2010, 12:59, edited 1 time in total.
JSF2 - Primefaces-3.1.RC1
-
- Posts: 24
- Joined: 22 Oct 2010, 20:00
I can't say that this is the best way to do it but it's working:
Code: Select all
<p:commandLink
action="#{mBean.addNewRow}"
value="Add new row" styleClass="icon icon-add"
update="items-list messages" oncomplete="editLastDatatableRow();" />
function editLastDatatableRow(){
jQuery('.ui-datatable-data tr').last().find('span.ui-icon-pencil').each(function(){
jQuery(this).click()
});
}
JSF2 - Primefaces-3.1.RC1
- bumble.bee
- Posts: 723
- Joined: 29 Sep 2010, 21:39
- Location: United States
Thanks for posting your solution. Being able to control whether the row is in edit mode is a good feature.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 29 guests