reload data for Kendo-UI datatable

289 views
Skip to first unread message

Arryandra Luis

unread,
Jul 8, 2013, 4:40:37 AM7/8/13
to wicket-j...@googlegroups.com
hi Sebastien,

I need to re-populate the table row, each time after i insert a new item / update existing item 

can you inform me how to reload kendo-UI datatable data ?


here is example of my dataTable  :


listOfRoleBean = retrieveAllRole();

roleDataProvider = new ListDataProvider<RoleBean>(listOfRoleBean);

roleDataTable = new DataTable<RoleBean>("roleDataTable", tableColumns, roleDataProvider, 10, tableOptions) {

@Override
public void onClick(AjaxRequestTarget target, ColumnButton button,
String value) {
triggerMessage(Cons.INFO, "Select role with id : " + value);

target.add(jGrowl);
}

};
roleDataTable.setOutputMarkupId(true);



Please kindly advise.

regards.

Sebastien Briquet

unread,
Jul 8, 2013, 7:59:29 AM7/8/13
to wicket-j...@googlegroups.com
Hi

The Kendo UI DataTable is not yet fully implemented...
I will add a #refresh() method, but for now on, you can use this one (I did not tested it):


            @Override
            public void onClick(AjaxRequestTarget target, ColumnButton button, String value) {

                /* ... */

                this.refresh(target);
            }

            /**
             * Will be added into wicket-kendo-ui.
             * You will have an error in the next release (cannot reduce visibility) so you will be able to remove this method.
             */
            private void refresh(AjaxRequestTarget target) {
                target.appendJavaScript(String.format("var grid = $('%s').data('kendoGrid'); grid.refresh();", JQueryWidget.getSelector(this)));
            }

Best regards,
Sebastien.

Arryandra Luis

unread,
Jul 8, 2013, 11:08:58 PM7/8/13
to wicket-j...@googlegroups.com
hi Sebastien,

thanks for your response, i will give it a try.


regards.
Reply all
Reply to author
Forward
0 new messages