Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
ViewAdminpanel
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
amal
ViewAdminpanel
Commits
1cf3bc54
Commit
1cf3bc54
authored
5 years ago
by
Jansa Jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
datatable in table page
parent
7a6385c9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
20 deletions
+40
-20
Tables.vue
src/components/views/Tables.vue
+36
-20
routes.js
src/routes.js
+4
-0
No files found.
src/components/views/Tables.vue
View file @
1cf3bc54
...
@@ -15,21 +15,15 @@
...
@@ -15,21 +15,15 @@
</div>
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-sm-12 table-responsive"
>
<div
class=
"col-sm-12 table-responsive"
>
<table
aria-describedby=
"example1_info"
role=
"grid"
id=
"example1"
class=
"table table-bordered table-striped dataTable
"
>
<table
id=
"example1"
class=
"table table-bordered table-striped dataTable"
cellspacing=
"0"
width=
"100%
"
>
<thead>
<thead>
<tr
role=
"row"
>
<tr
role=
"row"
>
<th
aria-label=
"Date: activate to sort column descending"
aria-sort=
"ascending"
style=
"width: 167px;"
colspan=
"1"
rowspan=
"1"
aria-controls=
"example1"
tabindex=
"0"
class=
"sorting_asc"
>
Date
</th>
<th>
Date
</th>
<th
aria-label=
"Description: activate to sort column ascending"
style=
"width: 207px;"
colspan=
"1"
rowspan=
"1"
aria-controls=
"example1"
tabindex=
"0"
class=
"sorting"
>
Description
</th>
<th>
Description
</th>
<th
aria-label=
"Amount: activate to sort column ascending"
style=
"width: 182px;"
colspan=
"1"
rowspan=
"1"
aria-controls=
"example1"
tabindex=
"0"
class=
"sorting"
>
Amount
</th>
<th>
Amount
</th>
</tr>
</tr>
</thead>
</thead>
<!--
<tbody
v-if=
"transactions"
>
<tbody></tbody>
<tr
class=
"even"
role=
"row"
v-for=
"trans in transactions"
:key=
"trans"
>
<td
class=
"sorting_1"
>
{{
trans
.
date
}}
</td>
<td>
{{
trans
.
description
}}
</td>
<td>
{{
trans
.
amount
}}
</td>
</tr>
</tbody>
-->
</table>
</table>
</div>
</div>
</div>
</div>
...
@@ -51,17 +45,10 @@ require('datatables.net-bs')
...
@@ -51,17 +45,10 @@ require('datatables.net-bs')
export
default
{
export
default
{
name
:
'Tables'
,
name
:
'Tables'
,
mounted
()
{
data
:
{
this
.
getData
()
dataTable
:
null
this
.
loadDatatable
()
this
.
access_token
=
localStorage
.
getItem
(
'token'
)
},
},
methods
:
{
methods
:
{
loadDatatable
()
{
this
.
$nextTick
(()
=>
{
$
(
'#example1'
).
DataTable
()
})
},
getData
()
{
getData
()
{
var
params
=
{
'client_id'
:
config
.
clientId
,
'client_secret'
:
config
.
clientSecret
,
'access_token'
:
this
.
access_token
}
var
params
=
{
'client_id'
:
config
.
clientId
,
'client_secret'
:
config
.
clientSecret
,
'access_token'
:
this
.
access_token
}
var
thisObj
=
this
var
thisObj
=
this
...
@@ -84,6 +71,35 @@ export default {
...
@@ -84,6 +71,35 @@ export default {
toggleLoading
()
{
toggleLoading
()
{
this
.
loading
=
this
.
loading
===
''
?
'loading'
:
''
this
.
loading
=
this
.
loading
===
''
?
'loading'
:
''
}
}
},
mounted
()
{
let
users
=
[]
this
.
access_token
=
localStorage
.
getItem
(
'token'
)
this
.
dataTable
=
$
(
'#example1'
).
DataTable
({})
var
params
=
{
'client_id'
:
config
.
clientId
,
'client_secret'
:
config
.
clientSecret
,
'access_token'
:
this
.
access_token
}
var
thisObj
=
this
api
.
request
(
'post'
,
'listTransactions'
,
params
)
.
then
(
response
=>
{
thisObj
.
toggleLoading
()
var
data
=
response
.
data
if
(
data
.
status
===
'success'
)
{
data
.
data
.
resources
.
forEach
(
item
=>
{
users
.
push
(
item
)
})
users
.
forEach
(
user
=>
{
this
.
dataTable
.
row
.
add
([
user
.
date
,
user
.
description
,
user
.
amount
]).
draw
(
false
)
})
}
})
.
catch
(()
=>
{
thisObj
.
$store
.
commit
(
'TOGGLE_LOADING'
)
thisObj
.
response
=
'Server appears to be offline'
})
}
}
}
}
</
script
>
</
script
>
...
...
This diff is collapsed.
Click to expand it.
src/routes.js
View file @
1cf3bc54
...
@@ -11,6 +11,10 @@ const routes = [
...
@@ -11,6 +11,10 @@ const routes = [
component
:
LoginView
component
:
LoginView
},
},
{
{
path
:
'/login'
,
component
:
LoginView
},
{
path
:
'/signup'
,
path
:
'/signup'
,
component
:
SignupView
component
:
SignupView
},
},
...
...
This diff is collapsed.
Click to expand it.
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