Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-adminpanel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
laravel-adminpanel
Commits
25fa8361
Commit
25fa8361
authored
Feb 26, 2018
by
cygnet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes for datatable
parent
0241a481
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
5 deletions
+55
-5
admin.js
public/js/backend/admin.js
+2
-2
deactivated.blade.php
resources/views/backend/access/users/deactivated.blade.php
+44
-1
index.blade.php
resources/views/backend/access/users/index.blade.php
+9
-2
No files found.
public/js/backend/admin.js
View file @
25fa8361
...
...
@@ -315,7 +315,7 @@ var Backend = {}; // common variable used in all the files of the backend
init
:
function
(
dataTable
)
{
this
.
setSelectors
();
this
.
addHandlers
();
this
.
addHandlers
(
dataTable
);
},
setSelectors
:
function
(){
...
...
@@ -339,7 +339,7 @@ var Backend = {}; // common variable used in all the files of the backend
Backend
.
DataTableSearch
.
setSelectors
();
callback
(
this
.
selector
.
searchInput
);
},
addHandlers
:
function
(){
addHandlers
:
function
(
dataTable
){
// get the datatable search input and on its key press check if we hit enter then search with datatable
this
.
cloneElement
(
this
.
selector
.
searchInput
,
function
(
element
){
//cloning done to remove any binding of the events
element
.
onkeypress
=
function
(
event
){
...
...
resources/views/backend/access/users/deactivated.blade.php
View file @
25fa8361
...
...
@@ -68,6 +68,49 @@
{{-- For DataTables --}}
{{ Html::script(mix('js/dataTable.js')) }}
<script>
(function () {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="
csrf
-
token
"]').attr('content')
}
});
var dataTable = $('#users-table').dataTable({
processing: true,
serverSide: true,
ajax: {
url: '{{ route("
admin
.
access
.
user
.
get
") }}',
type: 'post',
data: {status: 0, trashed: false}
},
columns: [
{data: 'first_name', name: '
{
{config('access.users_table')}}.first_name'
}
,
{data: 'last_name', name: '
{
{config('access.users_table')}}.last_name'
}
,
{data: 'email', name: '
{
{config('access.users_table')}}.email'
}
,
{data: 'confirmed', name: '
{
{config('access.users_table')}}.confirmed'
}
,
{data: 'roles', name: '
{
{config('access.roles_table')}
}
.name', sortable: false},
{data: 'created_at', name: '
{
{config('access.users_table')}}.created_at'
}
,
{data: 'updated_at', name: '
{
{config('access.users_table')}}.updated_at'
}
,
{data: 'actions', name: 'actions', searchable: false, sortable: false}
],
order: [[0, "
asc
"]],
searchDelay: 500,
dom: 'lBfrtip',
buttons: {
buttons: [
{ extend: 'copy', className: 'copyButton', exportOptions: {columns: [ 0, 1, 2, 3, 4, 5, 6 ] }},
{ extend: 'csv', className: 'csvButton', exportOptions: {columns: [ 0, 1, 2, 3, 4, 5, 6 ] }},
{ extend: 'excel', className: 'excelButton', exportOptions: {columns: [ 0, 1, 2, 3, 4, 5, 6 ] }},
{ extend: 'pdf', className: 'pdfButton', exportOptions: {columns: [ 0, 1, 2, 3, 4, 5, 6 ] }},
{ extend: 'print', className: 'printButton', exportOptions: {columns: [ 0, 1, 2, 3, 4, 5, 6 ] }}
]
}
});
Backend.DataTableSearch.init(dataTable);
})();
/*
$(function() {
var dataTable = $('#users-table').dataTable({
processing: true,
...
...
@@ -102,6 +145,6 @@
});
Backend.DataTableSearch.init(dataTable);
});
});
*/
</script>
@endsection
resources/views/backend/access/users/index.blade.php
View file @
25fa8361
...
...
@@ -81,7 +81,14 @@
{{ Html::script(mix('js/dataTable.js')) }}
<script>
$(function() {
(function() {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="
csrf
-
token
"]').attr('content')
}
});
var dataTable = $('#users-table').dataTable({
processing: true,
serverSide: true,
...
...
@@ -116,6 +123,6 @@
});
Backend.DataTableSearch.init(dataTable);
});
})
()
;
</script>
@endsection
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment