How can have opportunity to find row column create by select, option element html?
How can have opportunity to find row column create by select, option element html?
maksim79
Posts: 1Questions: 1Answers: 0
How can try begin understand how create custom search row create by selected option element ?
$(document).ready(function () {
var table = jQuery(function () {
$("#usersPasswordRoleTest").DataTable({ 'pagingType': "full_numbers",
'paging': true,
'lengthChange': true,
'searching': true,
'ordering': true,
'info': true,
'autoWidth': true,
"iDisplayLength": 20,
"language": {
"infoFiltered": "(Отфильтровано _MAX_ записей)",
"zeroRecords": "Записей не найдено",
"info": "Показано с _START_ по _END_ записей из _TOTAL_",
"lengthMenu": "Показывать _MENU_ записей на странице",
"infoEmpty": "Нет записей.",
"search": "Поиск:",
"paginate": {
"first": "Первая",
"previous": "Предыдущая",
"last": "Последняя",
"next": "Следующая",
}
}
});
});
})
<th class="th-clickable registration_role_password" name="role" order="asc"><span>Роль</span></th>
+
<td>' + '<select class="form-control" name="userRole" userid="' + user.id + '">';
$.each(roles, function (index, role) {
if (user.role.name === role.name) {
spsub += '<option value="' + role.id + '" text="' + role.name + '" selected>' + role.name + '</option>';
} else {
spsub += '<option value="' + role.id + '" text="' + role.name + '">' + role.name + '</option>';
}
});
spsub += '</select></td>' +
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
Answers
Do you mean
select
elements to search the table - if so, this example should help,Colin