3 * Copyright(c) 2006-2010 Ext JS, Inc.
5 * http://www.extjs.com/license
8 * Plugin for PagingToolbar which replaces the textfield input with a slider
10 Ext.ux.SlidingPager = Ext.extend(Object, {
11 init : function(pbar){
12 var idx = pbar.items.indexOf(pbar.inputItem);
13 Ext.each(pbar.items.getRange(idx - 2, idx + 2), function(c){
16 var slider = new Ext.Slider({
20 plugins: new Ext.slider.Tip({
21 getText : function(thumb) {
22 return String.format('Page <b>{0}</b> of <b>{1}</b>', thumb.value, thumb.slider.maxValue);
26 changecomplete: function(s, v){
31 pbar.insert(idx + 1, slider);
33 change: function(pb, data){
34 slider.setMaxValue(data.pages);
35 slider.setValue(data.activePage);