Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
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
pve-manager
Commits
b299a28f
Commit
b299a28f
authored
Jul 03, 2015
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
copy grid/PendingObjectGrid.js from manager to manager5
parent
7a657bb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
94 additions
and
0 deletions
+94
-0
PendingObjectGrid.js
www/manager5/grid/PendingObjectGrid.js
+94
-0
No files found.
www/manager5/grid/PendingObjectGrid.js
0 → 100644
View file @
b299a28f
Ext
.
define
(
'
PVE.grid.PendingObjectGrid
'
,
{
extend
:
'
PVE.grid.ObjectGrid
'
,
alias
:
[
'
widget.pvePendingObjectGrid
'
],
getObjectValue
:
function
(
key
,
defaultValue
,
pending
)
{
var
me
=
this
;
var
rec
=
me
.
store
.
getById
(
key
);
if
(
rec
)
{
var
value
=
(
pending
&&
Ext
.
isDefined
(
rec
.
data
.
pending
)
&&
(
rec
.
data
.
pending
!==
''
))
?
rec
.
data
.
pending
:
rec
.
data
.
value
;
if
(
Ext
.
isDefined
(
value
)
&&
(
value
!==
''
))
{
return
value
;
}
else
{
return
defaultValue
;
}
}
return
defaultValue
;
},
hasPendingChanges
:
function
(
key
)
{
var
me
=
this
;
var
rows
=
me
.
rows
;
var
rowdef
=
(
rows
&&
rows
[
key
])
?
rows
[
key
]
:
{};
var
keys
=
rowdef
.
multiKey
||
[
key
];
var
pending
=
false
;
Ext
.
Array
.
each
(
keys
,
function
(
k
)
{
var
rec
=
me
.
store
.
getById
(
k
);
if
(
rec
&&
rec
.
data
&&
Ext
.
isDefined
(
rec
.
data
.
pending
)
&&
(
rec
.
data
.
pending
!==
''
))
{
pending
=
true
;
}
});
return
pending
;
},
renderValue
:
function
(
value
,
metaData
,
record
,
rowIndex
,
colIndex
,
store
)
{
var
me
=
this
;
var
rows
=
me
.
rows
;
var
key
=
record
.
data
.
key
;
var
rowdef
=
(
rows
&&
rows
[
key
])
?
rows
[
key
]
:
{};
var
renderer
=
rowdef
.
renderer
;
var
current
=
''
;
var
pendingdelete
=
''
;
var
pending
=
''
;
if
(
renderer
)
{
current
=
renderer
(
value
,
metaData
,
record
,
rowIndex
,
colIndex
,
store
,
false
);
if
(
me
.
hasPendingChanges
(
key
))
{
pending
=
renderer
(
record
.
data
.
pending
,
metaData
,
record
,
rowIndex
,
colIndex
,
store
,
true
);
}
if
(
pending
==
current
)
{
pending
=
undefined
;
}
}
else
{
current
=
value
;
pending
=
record
.
data
.
pending
;
}
if
(
record
.
data
[
'
delete
'
])
{
pendingdelete
=
'
<div style="text-decoration: line-through;">
'
+
current
+
'
</div>
'
;
}
if
(
pending
||
pendingdelete
)
{
return
current
+
'
<div style="color:red">
'
+
pending
+
pendingdelete
+
'
</div>
'
;
}
else
{
return
current
;
}
},
initComponent
:
function
()
{
var
me
=
this
;
var
rows
=
me
.
rows
;
if
(
!
me
.
rstore
)
{
if
(
!
me
.
url
)
{
throw
"
no url specified
"
;
}
me
.
rstore
=
Ext
.
create
(
'
PVE.data.ObjectStore
'
,
{
model
:
'
KeyValuePendingDelete
'
,
readArray
:
true
,
url
:
me
.
url
,
interval
:
me
.
interval
,
extraParams
:
me
.
extraParams
,
rows
:
me
.
rows
});
}
me
.
callParent
();
}
});
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