Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
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
Kulya
OpnSense
Commits
c0d89557
Commit
c0d89557
authored
May 28, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(mvc) add default datagrid wrapper
parent
27f161d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
opnsense_ui.js
src/opnsense/www/js/opnsense_ui.js
+28
-0
No files found.
src/opnsense/www/js/opnsense_ui.js
View file @
c0d89557
...
...
@@ -250,4 +250,32 @@ function stdDialogRemoveItem(message, callback) {
}
}
});
}
/**
* wrapper around bootgrid component to use our defaults (including scaling footer)
* @param id
* @param sourceUrl
*/
function
stdBootgridUI
(
id
,
sourceUrl
)
{
var
grid
=
$
(
"
#
"
+
id
).
bootgrid
({
ajax
:
true
,
selection
:
true
,
multiSelect
:
true
,
rowCount
:[
7
,
14
,
20
,
-
1
],
url
:
sourceUrl
,
formatters
:
{
"
commands
"
:
function
(
column
,
row
)
{
return
"
<button type=
\"
button
\"
class=
\"
btn btn-xs btn-default command-edit
\"
data-row-id=
\"
"
+
row
.
uuid
+
"
\"
><span class=
\"
fa fa-pencil
\"
></span></button>
"
+
"
<button type=
\"
button
\"
class=
\"
btn btn-xs btn-default command-delete
\"
data-row-id=
\"
"
+
row
.
uuid
+
"
\"
><span class=
\"
fa fa-trash-o
\"
></span></button>
"
;
}
}
}).
on
(
"
loaded.rs.jquery.bootgrid
"
,
function
(
e
)
{
// scale footer on resize
$
(
this
).
find
(
"
tfoot td:first-child
"
).
attr
(
'
colspan
'
,
$
(
this
).
find
(
"
th
"
).
length
-
1
);
})
return
grid
;
}
\ No newline at end of file
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