You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2012/10/19 09:46:04 UTC

[jira] [Resolved] (WICKET-4823) While trying to update the jquery-datatable via AJAX it gets detached from the JQuery structure

     [ https://issues.apache.org/jira/browse/WICKET-4823?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-4823.
-------------------------------------

    Resolution: Not A Problem

Hi,

Please use users@wicket.apache.org mailing list for questions like this.

The problem is that jQuery DataTables works with something like data source. I.e. you have to feed it with JSON as its new data instead of repainting it.

Wicket Ajax component repainting works by completely replacing the HTML element in the DOM.
If you want to still use the normal Wicket way then you need to add something like:

     target.appendJavaScript("jQuery('#"+tableComponent.getMarkupId()+"').datatable();")

so the new <table> element will be tagged as JQuery DataTables too.
                
> While trying to update the jquery-datatable via AJAX it gets detached from the JQuery structure
> -----------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4823
>                 URL: https://issues.apache.org/jira/browse/WICKET-4823
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>            Reporter: Luis Perez Sanchez
>
> We are trying to change via AJAX request the content of a jquery-datatable by changing the list of elements inside.
> This is done by using the method setList of the ListView<?> object initially added to the datatable, then the datatable is added to the AjaxRequestTarget involved in the Ajax request, for the refreshing of the component.
> And indeed the data is actually changed in the page, but the datatable gets detached from JQuery, thus loosing the formatting, the filters, etc. It is like it is not treated as a JQueryDatatable anymore in the client.
> Has this happened to you before??
> Best Regards,
> Luis

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira