Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

查询分页 & 几个ext扩展

  • Loading branch information...
commit 879ec010fa30e8d22f6a2063aa9057af29f1375f 1 parent fb5f751
@xEasy xEasy authored
View
13 app/controllers/homes_controller.rb
@@ -2,8 +2,12 @@ class HomesController < ApplicationController
def index
end
- def get_classes_students
- render_json Classes.find(params[:c_id]).students.number_like(params[:query]).order("#{params[:sort]} #{params[:dir]}").collect &fields_provider
+ def get_students
+ code = "Student.number_like(params[:query])"
+ result = eval( params[:c_id] ? code + ".classes_id_equals(params[:c_id])" : code)
+ total = result.count
+ result = result.order("#{params[:sort]} #{params[:dir]}").limit((params[:limit] || 25).to_i).offset(params[:start].to_i || 0).collect &fields_provider
+ render :json => { :root => result, :total => total }
end
def get_classes
@@ -26,7 +30,10 @@ def comment_type_tree_nodes
end
def commets_by_type
- render_json CommentType.find(params[:ct_id]).comments.content_like(params[:query]).collect &fields_provider
+ result = CommentType.find(params[:ct_id]).comments.content_like(params[:query])
+ total = result.count
+ result = result.order("#{params[:sort]} #{params[:dir]}").limit((params[:limit] || 15)).offset(params[:start].to_i || 0).collect &fields_provider
+ render :json => { :root => result, :total => total }
end
end
View
7 app/views/homes/comment_student.html.erb
@@ -1,5 +1,10 @@
-<%= javascript_include_tag '/javascripts/PF/pages/comment_student.js' %>
+<style type="text/css" media="screen">
+ .x-grid3-cell-inner, .x-grid3-hd-inner {
+ white-space: pre-wrap;
+ }
+</style>
+<%= javascript_include_tag '/javascripts/PF/pages/comment_student.js' %>
<script language="javascript" type="text/javascript">
Ext.onReady(function() {
Pf.classes.commentStudent = new Pf.classes.commentStudent.MainPanel();
View
5 app/views/layouts/application.html.erb
@@ -6,8 +6,10 @@
<%= javascript_include_tag 'Extjs/ext-all-debug.js' %>
<%= javascript_include_tag 'Extjs/ext-lang-zh_CN.js' %>
- <%= javascript_include_tag 'Extjs/ux/SearchField.js' %>
+ <%= javascript_include_tag 'PF/widgets/SearchField.js' %>
<%= javascript_include_tag 'Extjs/ux/FileUploadField.js' %>
+ <%= javascript_include_tag 'PF/widgets/GroupSummary.js' %>
+ <%= javascript_include_tag 'PF/widgets/SlidingPager.js' %>
<%= javascript_include_tag 'PF/public/init.js' %>
<%= javascript_include_tag 'PF/util/util.js' %>
@@ -16,6 +18,7 @@
<%= stylesheet_link_tag '/javascripts/Extjs/resources/css/ext-all.css' %>
<%= stylesheet_link_tag '/javascripts/Extjs/resources/css/xtheme-gray.css' %>
+ <%= stylesheet_link_tag 'GroupSummary.css' %>
<%= stylesheet_link_tag 'menu-style.css' %>
<%= stylesheet_link_tag 'fileuploadfield.css' %>
<%= stylesheet_link_tag 'button_icon.css' %>
View
4 config/routes.rb
@@ -3,9 +3,9 @@
collection do
get "index"
get "get_classes"
- get 'get_classes_students'
+ get 'get_students'
get 'student_detail'
- get 'student_score'
+ post 'student_score'
get 'comment_student'
post 'comment_type_tree_nodes'
get 'commets_by_type'
View
19 public/javascripts/PF/pages/comment_student.js
@@ -139,7 +139,9 @@ Pf.classes.commentStudent.MainPanel = Ext.extend(Ext.Panel, {
emptyText : '请选择学生',
editable : false,
onTrigger2Click : function() {
- if (currentClasses != undefined) { scope.studentGrid.getStore().reload(); };
+ //if (currentClasses != undefined) {
+ scope.studentGrid.getStore().load();
+ //};
scope.studentWin.show();
}
});
@@ -177,10 +179,10 @@ Pf.classes.commentStudent.MainPanel = Ext.extend(Ext.Panel, {
name: 'sex',
readOnly: true
},{
- fieldLabel: '评级',
- name: 'grade',
- readOnly: true
- }, {
+ // fieldLabel: '评级',
+ // name: 'grade',
+ // readOnly: true
+ //}, {
fieldLabel: '备注',
name: 'remark',
readOnly: true
@@ -214,6 +216,7 @@ Pf.classes.commentStudent.MainPanel = Ext.extend(Ext.Panel, {
height : 230,
collapsible: true,
loadMask : true,
+ frame : true,
//collapseMode: 'mini',
store: store,
cm : cm,
@@ -229,7 +232,7 @@ Pf.classes.commentStudent.MainPanel = Ext.extend(Ext.Panel, {
var scope = this;
var store = new Pf.util.FieldsJsonStore({
root : 'root',
- url : '/homes/get_classes_students.json',
+ url : '/homes/get_students.json',
fields : [
"id",
'name',
@@ -241,9 +244,10 @@ Pf.classes.commentStudent.MainPanel = Ext.extend(Ext.Panel, {
'classes/name',
'comment',
'image/url',
- 'grade',
+ //'grade',
]
});
+ store.load();
var cm = new Ext.grid.ColumnModel({
columns: [
@@ -299,6 +303,7 @@ Pf.classes.commentStudent.MainPanel = Ext.extend(Ext.Panel, {
'学号查询: ', ' ', new Ext.ux.form.SearchField({ store: store, width: 220 })
]
}),
+ bbar: new Pf.util.Bbar({ store : store }),
sm : new Ext.grid.RowSelectionModel({ }),
listeners: {
celldblclick : function(grid,rowIndex,columnIndex) {
View
58 public/javascripts/PF/pages/home_index.js
@@ -32,7 +32,7 @@ Pf.classes.homeIndex.MainPanel = Ext.extend(Ext.Panel, {
var scope = this;
var store = new Pf.util.FieldsJsonStore({
root : 'root',
- url : '/homes/get_classes_students.json',
+ url : '/homes/get_students.json',
fields : [
"id",
'name',
@@ -45,8 +45,9 @@ Pf.classes.homeIndex.MainPanel = Ext.extend(Ext.Panel, {
'comment',
'image/url',
'grade'
- ]
+ ]
});
+ store.load();
var cm = new Ext.grid.ColumnModel({
columns: [
@@ -74,7 +75,7 @@ Pf.classes.homeIndex.MainPanel = Ext.extend(Ext.Panel, {
var store = Ext.getCmp("student-grid").getStore();
store.removeAll();
store.setBaseParam("c_id", record.get("id"));
- store.load();
+ store.reload();
}
}
});
@@ -86,7 +87,7 @@ Pf.classes.homeIndex.MainPanel = Ext.extend(Ext.Panel, {
border: false,
containerScroll: true,
loadMask : true,
- width: 200,
+ width: 250,
region: 'west',
split: true,
title : "学生列表",
@@ -97,6 +98,11 @@ Pf.classes.homeIndex.MainPanel = Ext.extend(Ext.Panel, {
labelWidth : 1,
items : ['班级:',classCombox, '学号查询:',new Ext.ux.form.SearchField({ emptyText : '请输入学号' ,store: store, width: 180 }) ]
}),
+ bbar: new Ext.PagingToolbar({
+ pageSize: 25,
+ store: store,
+ plugins: new Ext.ux.SlidingPager()
+ }),
sm : new Ext.grid.RowSelectionModel({
listeners : {
rowselect : function (model, row, record) {
@@ -126,25 +132,57 @@ Pf.classes.homeIndex.MainPanel = Ext.extend(Ext.Panel, {
});
var cm = new Ext.grid.ColumnModel({
columns: [
- { header: '科目' , dataIndex: 'course/name', width : 50 },
{ header: '学期' , dataIndex: 'grade',width : 50 },
- { header: '成绩' , dataIndex: 'score', width : 50 },
+ { header: '科目' , dataIndex: 'course/name', width : 50,
+ summaryType: 'count',
+ summaryRenderer: function(v, params, data) { return ((v === 0 || v > 1) ? '(' + v + ' 科目)' : '(1 科目)'); }
+ },
+ { header: '成绩' , dataIndex: 'score', width : 50,
+ summaryType: 'sum',
+ summaryRenderer: function(v, params, data) { return "总分: " + ( v ); }
+ },
{ header: '成绩评级' , dataIndex: 'score_type', width : 50 },
{ header: '备注' , dataIndex: 'remark' },
],
defaults: { menuDisabled : true, sortable : true }
});
+
+ var reader = new Ext.data.JsonReader({
+ root : 'root',
+ fields : ['course/name','grade','score','remark','score_type']
+ });
+
+ // utilize custom extension for Group Summary
+ var summary = new Ext.ux.grid.GroupSummary();
+ var ds = new Ext.data.GroupingStore({
+ reader: reader,
+ url : '/homes/student_score.json',
+ groupField: 'grade'
+ });
+ ds.on('beforeload', function(st, options) {
+ st.setBaseParam('fields[]',store.fields.keys);
+ });
+
var grid = new Ext.grid.EditorGridPanel({
id : 'score-grid',
- store: store,
- loadMask :true,
+ title : "学生成绩",
+ store: ds,
cm : cm,
+ loadMask :true,
height : 200,
- sm : new Ext.grid.RowSelectionModel({}),
- title : "学生成绩",
+ frame : true,
+ enableColumnMove: false,
+ plugins: summary,
stripeRows: true,
viewConfig: { forceFit: true },
+ view: new Ext.grid.GroupingView({
+ forceFit: true,
+ showGroupName: false,
+ enableNoGroups: false,
+ enableGroupingMenu: false,
+ }),
});
+
var form = new Ext.FormPanel({
region : 'center',
frame : true,
View
405 public/javascripts/PF/widgets/GroupSummary.js
@@ -0,0 +1,405 @@
+/*!
+ * Ext JS Library 3.2.1
+ * Copyright(c) 2006-2010 Ext JS, Inc.
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+/*!
+ * Ext JS Library 3.2.0
+ * Copyright(c) 2006-2010 Ext JS, Inc.
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+Ext.ns('Ext.ux.grid');
+
+/**
+ * @class Ext.ux.grid.GroupSummary
+ * @extends Ext.util.Observable
+ * A GridPanel plugin that enables dynamic column calculations and a dynamically
+ * updated grouped summary row.
+ */
+Ext.ux.grid.GroupSummary = Ext.extend(Ext.util.Observable, {
+ /**
+ * @cfg {Function} summaryRenderer Renderer example:<pre><code>
+summaryRenderer: function(v, params, data){
+ return ((v === 0 || v > 1) ? '(' + v +' Tasks)' : '(1 Task)');
+},
+ * </code></pre>
+ */
+ /**
+ * @cfg {String} summaryType (Optional) The type of
+ * calculation to be used for the column. For options available see
+ * {@link #Calculations}.
+ */
+
+ constructor : function(config){
+ Ext.apply(this, config);
+ Ext.ux.grid.GroupSummary.superclass.constructor.call(this);
+ },
+ init : function(grid){
+ this.grid = grid;
+ var v = this.view = grid.getView();
+ v.doGroupEnd = this.doGroupEnd.createDelegate(this);
+
+ v.afterMethod('onColumnWidthUpdated', this.doWidth, this);
+ v.afterMethod('onAllColumnWidthsUpdated', this.doAllWidths, this);
+ v.afterMethod('onColumnHiddenUpdated', this.doHidden, this);
+ v.afterMethod('onUpdate', this.doUpdate, this);
+ v.afterMethod('onRemove', this.doRemove, this);
+
+ if(!this.rowTpl){
+ this.rowTpl = new Ext.Template(
+ '<div class="x-grid3-summary-row" style="{tstyle}">',
+ '<table class="x-grid3-summary-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',
+ '<tbody><tr>{cells}</tr></tbody>',
+ '</table></div>'
+ );
+ this.rowTpl.disableFormats = true;
+ }
+ this.rowTpl.compile();
+
+ if(!this.cellTpl){
+ this.cellTpl = new Ext.Template(
+ '<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} {css}" style="{style}">',
+ '<div class="x-grid3-cell-inner x-grid3-col-{id}" unselectable="on">{value}</div>',
+ "</td>"
+ );
+ this.cellTpl.disableFormats = true;
+ }
+ this.cellTpl.compile();
+ },
+
+ /**
+ * Toggle the display of the summary row on/off
+ * @param {Boolean} visible <tt>true</tt> to show the summary, <tt>false</tt> to hide the summary.
+ */
+ toggleSummaries : function(visible){
+ var el = this.grid.getGridEl();
+ if(el){
+ if(visible === undefined){
+ visible = el.hasClass('x-grid-hide-summary');
+ }
+ el[visible ? 'removeClass' : 'addClass']('x-grid-hide-summary');
+ }
+ },
+
+ renderSummary : function(o, cs){
+ cs = cs || this.view.getColumnData();
+ var cfg = this.grid.getColumnModel().config,
+ buf = [], c, p = {}, cf, last = cs.length-1;
+ for(var i = 0, len = cs.length; i < len; i++){
+ c = cs[i];
+ cf = cfg[i];
+ p.id = c.id;
+ p.style = c.style;
+ p.css = i == 0 ? 'x-grid3-cell-first ' : (i == last ? 'x-grid3-cell-last ' : '');
+ if(cf.summaryType || cf.summaryRenderer){
+ p.value = (cf.summaryRenderer || c.renderer)(o.data[c.name], p, o);
+ }else{
+ p.value = '';
+ }
+ if(p.value == undefined || p.value === "") p.value = "&#160;";
+ buf[buf.length] = this.cellTpl.apply(p);
+ }
+
+ return this.rowTpl.apply({
+ tstyle: 'width:'+this.view.getTotalWidth()+';',
+ cells: buf.join('')
+ });
+ },
+
+ /**
+ * @private
+ * @param {Object} rs
+ * @param {Object} cs
+ */
+ calculate : function(rs, cs){
+ var data = {}, r, c, cfg = this.grid.getColumnModel().config, cf;
+ for(var j = 0, jlen = rs.length; j < jlen; j++){
+ r = rs[j];
+ for(var i = 0, len = cs.length; i < len; i++){
+ c = cs[i];
+ cf = cfg[i];
+ if(cf.summaryType){
+ data[c.name] = Ext.ux.grid.GroupSummary.Calculations[cf.summaryType](data[c.name] || 0, r, c.name, data);
+ }
+ }
+ }
+ return data;
+ },
+
+ doGroupEnd : function(buf, g, cs, ds, colCount){
+ var data = this.calculate(g.rs, cs);
+ buf.push('</div>', this.renderSummary({data: data}, cs), '</div>');
+ },
+
+ doWidth : function(col, w, tw){
+ if(!this.isGrouped()){
+ return;
+ }
+ var gs = this.view.getGroups(),
+ len = gs.length,
+ i = 0,
+ s;
+ for(; i < len; ++i){
+ s = gs[i].childNodes[2];
+ s.style.width = tw;
+ s.firstChild.style.width = tw;
+ s.firstChild.rows[0].childNodes[col].style.width = w;
+ }
+ },
+
+ doAllWidths : function(ws, tw){
+ if(!this.isGrouped()){
+ return;
+ }
+ var gs = this.view.getGroups(),
+ len = gs.length,
+ i = 0,
+ j,
+ s,
+ cells,
+ wlen = ws.length;
+
+ for(; i < len; i++){
+ s = gs[i].childNodes[2];
+ s.style.width = tw;
+ s.firstChild.style.width = tw;
+ cells = s.firstChild.rows[0].childNodes;
+ for(j = 0; j < wlen; j++){
+ cells[j].style.width = ws[j];
+ }
+ }
+ },
+
+ doHidden : function(col, hidden, tw){
+ if(!this.isGrouped()){
+ return;
+ }
+ var gs = this.view.getGroups(),
+ len = gs.length,
+ i = 0,
+ s,
+ display = hidden ? 'none' : '';
+ for(; i < len; i++){
+ s = gs[i].childNodes[2];
+ s.style.width = tw;
+ s.firstChild.style.width = tw;
+ s.firstChild.rows[0].childNodes[col].style.display = display;
+ }
+ },
+
+ isGrouped : function(){
+ return !Ext.isEmpty(this.grid.getStore().groupField);
+ },
+
+ // Note: requires that all (or the first) record in the
+ // group share the same group value. Returns false if the group
+ // could not be found.
+ refreshSummary : function(groupValue){
+ return this.refreshSummaryById(this.view.getGroupId(groupValue));
+ },
+
+ getSummaryNode : function(gid){
+ var g = Ext.fly(gid, '_gsummary');
+ if(g){
+ return g.down('.x-grid3-summary-row', true);
+ }
+ return null;
+ },
+
+ refreshSummaryById : function(gid){
+ var g = Ext.getDom(gid);
+ if(!g){
+ return false;
+ }
+ var rs = [];
+ this.grid.getStore().each(function(r){
+ if(r._groupId == gid){
+ rs[rs.length] = r;
+ }
+ });
+ var cs = this.view.getColumnData(),
+ data = this.calculate(rs, cs),
+ markup = this.renderSummary({data: data}, cs),
+ existing = this.getSummaryNode(gid);
+
+ if(existing){
+ g.removeChild(existing);
+ }
+ Ext.DomHelper.append(g, markup);
+ return true;
+ },
+
+ doUpdate : function(ds, record){
+ this.refreshSummaryById(record._groupId);
+ },
+
+ doRemove : function(ds, record, index, isUpdate){
+ if(!isUpdate){
+ this.refreshSummaryById(record._groupId);
+ }
+ },
+
+ /**
+ * Show a message in the summary row.
+ * <pre><code>
+grid.on('afteredit', function(){
+ var groupValue = 'Ext Forms: Field Anchoring';
+ summary.showSummaryMsg(groupValue, 'Updating Summary...');
+});
+ * </code></pre>
+ * @param {String} groupValue
+ * @param {String} msg Text to use as innerHTML for the summary row.
+ */
+ showSummaryMsg : function(groupValue, msg){
+ var gid = this.view.getGroupId(groupValue),
+ node = this.getSummaryNode(gid);
+ if(node){
+ node.innerHTML = '<div class="x-grid3-summary-msg">' + msg + '</div>';
+ }
+ }
+});
+
+//backwards compat
+Ext.grid.GroupSummary = Ext.ux.grid.GroupSummary;
+
+
+/**
+ * Calculation types for summary row:</p><div class="mdetail-params"><ul>
+ * <li><b><tt>sum</tt></b> : <div class="sub-desc"></div></li>
+ * <li><b><tt>count</tt></b> : <div class="sub-desc"></div></li>
+ * <li><b><tt>max</tt></b> : <div class="sub-desc"></div></li>
+ * <li><b><tt>min</tt></b> : <div class="sub-desc"></div></li>
+ * <li><b><tt>average</tt></b> : <div class="sub-desc"></div></li>
+ * </ul></div>
+ * <p>Custom calculations may be implemented. An example of
+ * custom <code>summaryType=totalCost</code>:</p><pre><code>
+// define a custom summary function
+Ext.ux.grid.GroupSummary.Calculations['totalCost'] = function(v, record, field){
+ return v + (record.data.estimate * record.data.rate);
+};
+ * </code></pre>
+ * @property Calculations
+ */
+
+Ext.ux.grid.GroupSummary.Calculations = {
+ 'sum' : function(v, record, field){
+ return v + (record.data[field]||0);
+ },
+
+ 'count' : function(v, record, field, data){
+ return data[field+'count'] ? ++data[field+'count'] : (data[field+'count'] = 1);
+ },
+
+ 'max' : function(v, record, field, data){
+ var v = record.data[field];
+ var max = data[field+'max'] === undefined ? (data[field+'max'] = v) : data[field+'max'];
+ return v > max ? (data[field+'max'] = v) : max;
+ },
+
+ 'min' : function(v, record, field, data){
+ var v = record.data[field];
+ var min = data[field+'min'] === undefined ? (data[field+'min'] = v) : data[field+'min'];
+ return v < min ? (data[field+'min'] = v) : min;
+ },
+
+ 'average' : function(v, record, field, data){
+ var c = data[field+'count'] ? ++data[field+'count'] : (data[field+'count'] = 1);
+ var t = (data[field+'total'] = ((data[field+'total']||0) + (record.data[field]||0)));
+ return t === 0 ? 0 : t / c;
+ }
+};
+Ext.grid.GroupSummary.Calculations = Ext.ux.grid.GroupSummary.Calculations;
+
+/**
+ * @class Ext.ux.grid.HybridSummary
+ * @extends Ext.ux.grid.GroupSummary
+ * Adds capability to specify the summary data for the group via json as illustrated here:
+ * <pre><code>
+{
+ data: [
+ {
+ projectId: 100, project: 'House',
+ taskId: 112, description: 'Paint',
+ estimate: 6, rate: 150,
+ due:'06/24/2007'
+ },
+ ...
+ ],
+
+ summaryData: {
+ 'House': {
+ description: 14, estimate: 9,
+ rate: 99, due: new Date(2009, 6, 29),
+ cost: 999
+ }
+ }
+}
+ * </code></pre>
+ *
+ */
+Ext.ux.grid.HybridSummary = Ext.extend(Ext.ux.grid.GroupSummary, {
+ /**
+ * @private
+ * @param {Object} rs
+ * @param {Object} cs
+ */
+ calculate : function(rs, cs){
+ var gcol = this.view.getGroupField(),
+ gvalue = rs[0].data[gcol],
+ gdata = this.getSummaryData(gvalue);
+ return gdata || Ext.ux.grid.HybridSummary.superclass.calculate.call(this, rs, cs);
+ },
+
+ /**
+ * <pre><code>
+grid.on('afteredit', function(){
+ var groupValue = 'Ext Forms: Field Anchoring';
+ summary.showSummaryMsg(groupValue, 'Updating Summary...');
+ setTimeout(function(){ // simulate server call
+ // HybridSummary class implements updateSummaryData
+ summary.updateSummaryData(groupValue,
+ // create data object based on configured dataIndex
+ {description: 22, estimate: 888, rate: 888, due: new Date(), cost: 8});
+ }, 2000);
+});
+ * </code></pre>
+ * @param {String} groupValue
+ * @param {Object} data data object
+ * @param {Boolean} skipRefresh (Optional) Defaults to false
+ */
+ updateSummaryData : function(groupValue, data, skipRefresh){
+ var json = this.grid.getStore().reader.jsonData;
+ if(!json.summaryData){
+ json.summaryData = {};
+ }
+ json.summaryData[groupValue] = data;
+ if(!skipRefresh){
+ this.refreshSummary(groupValue);
+ }
+ },
+
+ /**
+ * Returns the summaryData for the specified groupValue or null.
+ * @param {String} groupValue
+ * @return {Object} summaryData
+ */
+ getSummaryData : function(groupValue){
+ var reader = this.grid.getStore().reader,
+ json = reader.jsonData,
+ fields = reader.recordType.prototype.fields,
+ v;
+
+ if(json && json.summaryData){
+ v = json.summaryData[groupValue];
+ if(v){
+ return reader.extractValues(v, fields.items, fields.length);
+ }
+ }
+ return null;
+ }
+});
+
+//backwards compat
+Ext.grid.HybridSummary = Ext.ux.grid.HybridSummary;
View
0  public/javascripts/Extjs/ux/SearchField.js → public/javascripts/PF/widgets/SearchField.js
File renamed without changes
View
39 public/javascripts/PF/widgets/SlidingPager.js
@@ -0,0 +1,39 @@
+/*!
+ * Ext JS Library 3.2.1
+ * Copyright(c) 2006-2010 Ext JS, Inc.
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+/**
+ * Plugin for PagingToolbar which replaces the textfield input with a slider
+ */
+Ext.ux.SlidingPager = Ext.extend(Object, {
+ init : function(pbar){
+ var idx = pbar.items.indexOf(pbar.inputItem);
+ Ext.each(pbar.items.getRange(idx - 2, idx + 2), function(c){
+ c.hide();
+ });
+ var slider = new Ext.Slider({
+ width: 114,
+ minValue: 1,
+ maxValue: 1,
+ plugins: new Ext.slider.Tip({
+ getText : function(thumb) {
+ return String.format('Page <b>{0}</b> of <b>{1}</b>', thumb.value, thumb.slider.maxValue);
+ }
+ }),
+ listeners: {
+ changecomplete: function(s, v){
+ pbar.changePage(v);
+ }
+ }
+ });
+ pbar.insert(idx + 1, slider);
+ pbar.on({
+ change: function(pb, data){
+ slider.setMaxValue(data.pages);
+ slider.setValue(data.activePage);
+ }
+ });
+ }
+});
View
26 public/stylesheets/GroupSummary.css
@@ -0,0 +1,26 @@
+/*!
+ * Ext JS Library 3.2.1
+ * Copyright(c) 2006-2010 Ext JS, Inc.
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+.x-grid3-summary-row {
+ border-left:1px solid #fff;
+ border-right:1px solid #fff;
+ color:#333;
+ background: #f1f2f4;
+}
+.x-grid3-summary-row .x-grid3-cell-inner {
+ font-weight:bold;
+ padding-bottom:4px;
+}
+.x-grid3-cell-first .x-grid3-cell-inner {
+ padding-left:16px;
+}
+.x-grid-hide-summary .x-grid3-summary-row {
+ display:none;
+}
+.x-grid3-summary-msg {
+ padding:4px 16px;
+ font-weight:bold;
+}
Please sign in to comment.
Something went wrong with that request. Please try again.