Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
plugin_dbui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Gitlab has been updated. More info
here
.
Show more breadcrumbs
w2pext
plugin_dbui
Commits
850eff37
Commit
850eff37
authored
14 years ago
by
Renaud Le Gac
Browse files
Options
Downloads
Patches
Plain Diff
re-visited version
parent
b2a4cc1d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
static/plugin_dbui/src/appgridpaging.js
+20
-18
20 additions, 18 deletions
static/plugin_dbui/src/appgridpaging.js
with
20 additions
and
18 deletions
static/plugin_dbui/src/appgridpaging.js
+
20
−
18
View file @
850eff37
...
...
@@ -2,6 +2,10 @@
* The paging bottom bar plugin
* The ptype of this component is pGridPaging.
*
*
* NOTE: the number of row load in hte grid the first time is defined
* by the grid when loading the store.
*
* @version $Id$
*
*/
...
...
@@ -15,7 +19,7 @@ App.grid.Paging = Ext.extend(Object, {
ptype
:
'
pGridPaging
'
,
/**
* Plugin intiali
s
ation
* Plugin in
i
tiali
z
ation
*/
init
:
function
(
grid
)
{
...
...
@@ -50,12 +54,14 @@ App.grid.Paging = Ext.extend(Object, {
bbar
.
show
();
// NOTE: when this plugin is used, the grid load the store
// with the first row only. The results contains the total
// number of records in the store. We used it to initialized
// properly the slider.
grid
.
store
.
on
(
'
load
'
,
this
.
onStoreLoad
,
grid
);
// if the store is already load initialize the parameters
// of the paging and slider widgets
// Otherwise, way the store is loaded
if
(
grid
.
store
.
getTotalCount
()
>
0
)
{
this
.
onStoreLoad
.
call
(
grid
,
grid
.
store
);
}
else
{
grid
.
store
.
on
(
'
load
'
,
this
.
onStoreLoad
,
grid
);
}
},
/**
...
...
@@ -79,7 +85,10 @@ App.grid.Paging = Ext.extend(Object, {
*/
onStoreLoad
:
function
(
store
,
records
,
options
)
{
var
bbar
,
grid
=
this
,
nRows
=
10
,
slider
;
var
bbar
,
grid
=
this
,
nRows
=
store
.
getCount
(),
slider
;
if
(
grid
.
pagingInitialized
)
{
return
;
...
...
@@ -88,19 +97,12 @@ App.grid.Paging = Ext.extend(Object, {
grid
.
pagingInitialized
=
true
;
bbar
=
grid
.
getBottomToolbar
();
bbar
.
pageSize
=
nRows
;
slider
=
bbar
.
findByType
(
'
slider
'
)[
0
];
// NOTE: the number of row which visible in the browser
// can be obtained having a look to the DOM tree finding
// CSS component name x-grid3-cell-inner. Then by comparing
// the innerHeight of the browser window and the height of the
// cell we can compute the number of rows ? For later !!
slider
.
maxValue
=
store
.
totalLength
;
slider
.
maxValue
=
store
.
getTotalCount
();
slider
.
setValue
(
nRows
);
bbar
.
pageSize
=
nRows
;
bbar
.
moveFirst
();
}
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment