Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
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
ops
jumpserver
Commits
13b610c1
Commit
13b610c1
authored
Dec 31, 2017
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Change] 仅点击checkbox选中
parent
7558c2b3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
15 deletions
+22
-15
jumpserver.js
apps/static/js/jumpserver.js
+22
-15
No files found.
apps/static/js/jumpserver.js
View file @
13b610c1
...
@@ -253,9 +253,11 @@ jumpserver.initDataTable = function (options) {
...
@@ -253,9 +253,11 @@ jumpserver.initDataTable = function (options) {
{
{
targets
:
0
,
targets
:
0
,
orderable
:
false
,
orderable
:
false
,
createdCell
:
function
(
td
,
cellData
)
{
createdCell
:
function
(
td
,
cellData
)
{
$
(
td
).
html
(
'<input type="checkbox" class="text-center ipt_check" id=99991937>'
.
replace
(
'99991937'
,
cellData
));
$
(
td
).
html
(
'<input type="checkbox" class="text-center ipt_check" id=99991937>'
.
replace
(
'99991937'
,
cellData
));
}},
}
},
// className: 'select-checkbox'
{
className
:
'text-center'
,
targets
:
'_all'
}
{
className
:
'text-center'
,
targets
:
'_all'
}
];
];
columnDefs
=
options
.
columnDefs
?
options
.
columnDefs
.
concat
(
columnDefs
)
:
columnDefs
;
columnDefs
=
options
.
columnDefs
?
options
.
columnDefs
.
concat
(
columnDefs
)
:
columnDefs
;
...
@@ -263,7 +265,7 @@ jumpserver.initDataTable = function (options) {
...
@@ -263,7 +265,7 @@ jumpserver.initDataTable = function (options) {
pageLength
:
options
.
pageLength
||
15
,
pageLength
:
options
.
pageLength
||
15
,
dom
:
options
.
dom
||
'<"#uc.pull-left">flt<"row m-t"<"col-md-8"<"#op.col-md-6"><"col-md-6 text-center"i>><"col-md-4"p>>'
,
dom
:
options
.
dom
||
'<"#uc.pull-left">flt<"row m-t"<"col-md-8"<"#op.col-md-6"><"col-md-6 text-center"i>><"col-md-4"p>>'
,
order
:
options
.
order
||
[],
order
:
options
.
order
||
[],
select
:
options
.
select
||
'multi'
,
//
select: options.select || 'multi',
buttons
:
[],
buttons
:
[],
columnDefs
:
columnDefs
,
columnDefs
:
columnDefs
,
ajax
:
{
ajax
:
{
...
@@ -271,6 +273,10 @@ jumpserver.initDataTable = function (options) {
...
@@ -271,6 +273,10 @@ jumpserver.initDataTable = function (options) {
dataSrc
:
""
dataSrc
:
""
},
},
columns
:
options
.
columns
||
[],
columns
:
options
.
columns
||
[],
select
:
{
style
:
'multi'
,
selector
:
'td:first-child'
},
lengthMenu
:
[[
15
,
25
,
50
,
-
1
],
[
15
,
25
,
50
,
"All"
]]
lengthMenu
:
[[
15
,
25
,
50
,
-
1
],
[
15
,
25
,
50
,
"All"
]]
});
});
table
.
on
(
'select'
,
function
(
e
,
dt
,
type
,
indexes
)
{
table
.
on
(
'select'
,
function
(
e
,
dt
,
type
,
indexes
)
{
...
@@ -281,21 +287,22 @@ jumpserver.initDataTable = function (options) {
...
@@ -281,21 +287,22 @@ jumpserver.initDataTable = function (options) {
var
$node
=
table
[
type
](
indexes
).
nodes
().
to$
();
var
$node
=
table
[
type
](
indexes
).
nodes
().
to$
();
$node
.
find
(
'input.ipt_check'
).
prop
(
'checked'
,
false
);
$node
.
find
(
'input.ipt_check'
).
prop
(
'checked'
,
false
);
jumpserver
.
selected
[
$node
.
find
(
'input.ipt_check'
).
prop
(
'id'
)]
=
false
jumpserver
.
selected
[
$node
.
find
(
'input.ipt_check'
).
prop
(
'id'
)]
=
false
}).
on
(
'draw'
,
function
(){
}).
on
(
'draw'
,
function
(){
$
(
'#op'
).
html
(
options
.
op_html
||
''
);
$
(
'#op'
).
html
(
options
.
op_html
||
''
);
$
(
'#uc'
).
html
(
options
.
uc_html
||
''
);
$
(
'#uc'
).
html
(
options
.
uc_html
||
''
);
});
});
$
(
'.ipt_check_all'
).
on
(
'click'
,
function
()
{
//
$('.ipt_check_all').on('click', function() {
if
(
!
jumpserver
.
checked
)
{
//
if (!jumpserver.checked) {
$
(
this
).
closest
(
'table'
).
find
(
'.ipt_check'
).
prop
(
'checked'
,
true
);
//
$(this).closest('table').find('.ipt_check').prop('checked', true);
jumpserver
.
checked
=
true
;
//
jumpserver.checked = true;
table
.
rows
().
select
();
//
table.rows().select();
}
else
{
//
} else {
$
(
this
).
closest
(
'table'
).
find
(
'.ipt_check'
).
prop
(
'checked'
,
false
);
//
$(this).closest('table').find('.ipt_check').prop('checked', false);
jumpserver
.
checked
=
false
;
//
jumpserver.checked = false;
table
.
rows
().
deselect
();
//
table.rows().deselect();
}
//
}
});
//
});
return
table
;
return
table
;
};
};
...
...
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