Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fgqyxxlr
Overview
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
yaru
fgqyxxlr
Commits
eb7ef55a
Commit
eb7ef55a
authored
Jul 10, 2019
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
树表格支持多层级访问
parent
6c47f48e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-treetable/bootstrap-treetable.js
+15
-2
No files found.
ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-treetable/bootstrap-treetable.js
View file @
eb7ef55a
...
...
@@ -335,13 +335,13 @@
}
// 增加formatter渲染
if
(
column
.
formatter
)
{
$td
.
html
(
column
.
formatter
.
call
(
this
,
item
[
column
.
field
]
,
item
,
index
));
$td
.
html
(
column
.
formatter
.
call
(
this
,
getItemField
(
item
,
column
.
field
)
,
item
,
index
));
}
else
{
if
(
options
.
showTitle
){
// 只在字段没有formatter时才添加title属性
$td
.
attr
(
"title"
,
item
[
column
.
field
]);
}
$td
.
text
(
item
[
column
.
field
]
);
$td
.
text
(
getItemField
(
item
,
column
.
field
)
);
}
if
(
options
.
expandColumn
==
index
)
{
if
(
!
isP
)
{
...
...
@@ -583,6 +583,19 @@
$input
.
prop
(
"checked"
,
''
);
}
}
// ruoyi 解析数据,支持多层级访问
var
getItemField
=
function
(
item
,
field
)
{
var
value
=
item
;
if
(
typeof
field
!==
'string'
||
item
.
hasOwnProperty
(
field
))
{
return
item
[
field
];
}
var
props
=
field
.
split
(
'.'
);
for
(
var
p
in
props
)
{
value
=
value
&&
value
[
props
[
p
]];
}
return
value
;
};
// 初始化
init
();
return
target
;
...
...
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