I want to use datalist for set roles to the user. When I click to the "Roles" button I show the window with datalist:
$('#button_roles').linkbutton({
onClick: function () {
var row = gridUsers.datagrid('getSelected');
var windowRoles = $('#window_roles').window({
title: 'Roles of '+row.username
});
var listRoles = $('#list_roles').datalist({
url: baseUrl+'admin/users/rolesrest/userroles',
textField: 'name',
valueField: 'id',
queryParams: {user_id: row.id},
singleSelect: false,
lines: true
});
windowRoles.window('open');
}
});
My restful returns data (as for datagrid) with all roles list. But I need to set selected some roles assigned to the user. What the best way to do it?
Thank you.