Ext.define("Ext.ux.call2action.PagingToolbar", {

	extend: "Ext.toolbar.Paging",

	config: {
		filterField: null,
		store: null
	},

	initComponent: function() {

		var i_self = this;

		i_self.callParent();
	},

	getPagingItems: function() {

		var i_self = this;
		var i_store = i_self.getStore();

		var a_items = i_self.callParent();

		var i_filterField = Ext.create("Ext.form.field.Text", {
			width: 300,
			enableKeyEvents: true,
			itemId: "filterField",
			name: "filterField",
			listeners: {
				keydown: function(fld, e) {
					if (e.getKey() == e.ENTER) {
						i_store.load();
					}
				}
			}
		});

		a_items.push(i_filterField);

		i_self.setFilterField(i_filterField);

		return a_items;
	}
});
