projects
/
roojs1
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
roojs-core.js
[roojs1]
/
Roo
/
PagingToolbar.js
diff --git
a/Roo/PagingToolbar.js
b/Roo/PagingToolbar.js
index
17765e4
..
22f35d3
100644
(file)
--- a/
Roo/PagingToolbar.js
+++ b/
Roo/PagingToolbar.js
@@
-12,6
+12,7
@@
/**
* @class Roo.PagingToolbar
* @extends Roo.Toolbar
/**
* @class Roo.PagingToolbar
* @extends Roo.Toolbar
+ * @children Roo.Toolbar.Item Roo.Toolbar.Button Roo.Toolbar.SplitButton Roo.form.Field
* A specialized toolbar that is bound to a {@link Roo.data.Store} and provides automatic paging controls.
* @constructor
* Create a new PagingToolbar
* A specialized toolbar that is bound to a {@link Roo.data.Store} and provides automatic paging controls.
* @constructor
* Create a new PagingToolbar
@@
-27,9
+28,9
@@
Roo.PagingToolbar = function(el, ds, config)
el = config.container;
}
var items = [];
el = config.container;
}
var items = [];
- if (
this
.items) {
- items =
this
.items;
-
this
.items = [];
+ if (
config
.items) {
+ items =
config
.items;
+
config
.items = [];
}
Roo.PagingToolbar.superclass.constructor.call(this, el, null, config);
}
Roo.PagingToolbar.superclass.constructor.call(this, el, null, config);
@@
-39,18
+40,15
@@
Roo.PagingToolbar = function(el, ds, config)
this.bind(ds);
// supprot items array.
this.bind(ds);
// supprot items array.
- var _this = this;
+
Roo.each(items, function(e) {
Roo.each(items, function(e) {
-
_
this.add(Roo.factory(e));
- });
+ this.add(Roo.factory(e));
+ }
,this
);
};
Roo.extend(Roo.PagingToolbar, Roo.Toolbar, {
};
Roo.extend(Roo.PagingToolbar, Roo.Toolbar, {
- /**
- * @cfg {Roo.data.Store} dataSource
- * The underlying data store providing the paged data
- */
+
/**
* @cfg {String/HTMLElement/Element} container
* container The id or element that will contain the toolbar
/**
* @cfg {String/HTMLElement/Element} container
* container The id or element that will contain the toolbar
@@
-59,6
+57,8
@@
Roo.extend(Roo.PagingToolbar, Roo.Toolbar, {
* @cfg {Boolean} displayInfo
* True to display the displayMsg (defaults to false)
*/
* @cfg {Boolean} displayInfo
* True to display the displayMsg (defaults to false)
*/
+
+
/**
* @cfg {Number} pageSize
* The number of records to display per page (defaults to 20)
/**
* @cfg {Number} pageSize
* The number of records to display per page (defaults to 20)
@@
-232,8
+232,9
@@
Roo.extend(Roo.PagingToolbar, Roo.Toolbar, {
{
var v = this.field.dom.value, pageNum;
var increment = (e.shiftKey) ? 10 : 1;
{
var v = this.field.dom.value, pageNum;
var increment = (e.shiftKey) ? 10 : 1;
- if(k == e.DOWN || k == e.LEFT || k == e.PAGEDOWN)
+ if(k == e.DOWN || k == e.LEFT || k == e.PAGEDOWN)
{
increment *= -1;
increment *= -1;
+ }
if(!v || isNaN(pageNum = parseInt(v, 10))) {
this.field.dom.value = d.activePage;
return;
if(!v || isNaN(pageNum = parseInt(v, 10))) {
this.field.dom.value = d.activePage;
return;
@@
-254,7
+255,11
@@
Roo.extend(Roo.PagingToolbar, Roo.Toolbar, {
this.loading.disable();
}
},
this.loading.disable();
}
},
-
+ /**
+ * event that occurs when you click on the navigation buttons - can be used to trigger load of a grid.
+ * @param {String} which (first|prev|next|last|refresh) which button to press.
+ *
+ */
// private
onClick : function(which){
var ds = this.ds;
// private
onClick : function(which){
var ds = this.ds;