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
aced2be5
Commit
aced2be5
authored
Jun 23, 2015
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
copy grid/ObjectGrid.js from manager to manager5
parent
c410dce9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
109 additions
and
0 deletions
+109
-0
ObjectGrid.js
www/manager5/grid/ObjectGrid.js
+109
-0
No files found.
www/manager5/grid/ObjectGrid.js
0 → 100644
View file @
aced2be5
Ext
.
define
(
'
PVE.grid.ObjectGrid
'
,
{
extend
:
'
Ext.grid.GridPanel
'
,
alias
:
[
'
widget.pveObjectGrid
'
],
getObjectValue
:
function
(
key
,
defaultValue
)
{
var
me
=
this
;
var
rec
=
me
.
store
.
getById
(
key
);
if
(
rec
)
{
return
rec
.
data
.
value
;
}
return
defaultValue
;
},
renderKey
:
function
(
key
,
metaData
,
record
,
rowIndex
,
colIndex
,
store
)
{
var
me
=
this
;
var
rows
=
me
.
rows
;
var
rowdef
=
(
rows
&&
rows
[
key
])
?
rows
[
key
]
:
{};
return
rowdef
.
header
||
key
;
},
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
;
if
(
renderer
)
{
return
renderer
(
value
,
metaData
,
record
,
rowIndex
,
colIndex
,
store
);
}
return
value
;
},
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
'
,
{
url
:
me
.
url
,
interval
:
me
.
interval
,
extraParams
:
me
.
extraParams
,
rows
:
me
.
rows
});
}
var
rstore
=
me
.
rstore
;
var
store
=
Ext
.
create
(
'
PVE.data.DiffStore
'
,
{
rstore
:
rstore
});
if
(
rows
)
{
Ext
.
Object
.
each
(
rows
,
function
(
key
,
rowdef
)
{
if
(
Ext
.
isDefined
(
rowdef
.
defaultValue
))
{
store
.
add
({
key
:
key
,
value
:
rowdef
.
defaultValue
});
}
else
if
(
rowdef
.
required
)
{
store
.
add
({
key
:
key
,
value
:
undefined
});
}
});
}
if
(
me
.
sorterFn
)
{
store
.
sorters
.
add
(
new
Ext
.
util
.
Sorter
({
sorterFn
:
me
.
sorterFn
}));
}
store
.
filters
.
add
(
new
Ext
.
util
.
Filter
({
filterFn
:
function
(
item
)
{
if
(
rows
)
{
var
rowdef
=
rows
[
item
.
data
.
key
];
if
(
!
rowdef
||
(
rowdef
.
visible
===
false
))
{
return
false
;
}
}
return
true
;
}
}));
PVE
.
Utils
.
monStoreErrors
(
me
,
rstore
);
Ext
.
applyIf
(
me
,
{
store
:
store
,
hideHeaders
:
true
,
stateful
:
false
,
columns
:
[
{
header
:
gettext
(
'
Name
'
),
width
:
me
.
cwidth1
||
100
,
dataIndex
:
'
key
'
,
renderer
:
me
.
renderKey
},
{
flex
:
1
,
header
:
gettext
(
'
Value
'
),
dataIndex
:
'
value
'
,
renderer
:
me
.
renderValue
}
]
});
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