Author: abelevich
Date: 2007-06-07 11:33:26 -0400 (Thu, 07 Jun 2007)
New Revision: 1081
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js
Log:
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js 2007-06-07
14:51:18 UTC (rev 1080)
+++
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js 2007-06-07
15:33:26 UTC (rev 1081)
@@ -2,55 +2,48 @@
ClientUI.controls.grid.ScrollableGrid = Class.create({
CLASSDEF: {
- name: 'ClientUI.controls.grid.ScrollableGrid'
+ name: 'ClientUI.controls.grid.ScrollableGrid',
+ parent: ClientUI.controls.grid.Grid
}
});
Object.extend(ClientUI.controls.grid.ScrollableGrid.prototype, {
initialize: function(options) {
-
+
this.options = options;
this.client_id = this.options.client_id;
-
+ this.rows_count = $(this.client_id + "_rows_input").value;
this.columns_count = this.options.columnsCount;
this.splash_id = this.options.splash_id;
- this.rows_count = $(this.client_id + "_rows_input").value;
+ this.dataModel = new ClientUI.controls.grid.FakeArrayDataModel(this.rows_count,
this.columns_count, this.client_id);
+
+ this.templates = [
+ {pane: GridLayout_Enum.HEADER, ref: this.client_id +"_" +
"GridHeaderTemplate"},
+ {pane: GridLayout_Enum.BODY, ref: this.client_id +"_" +
"GridBodyTemplate"},
+ {pane: GridLayout_Enum.FOOTER, ref: this.client_id +"_" +
"GridFooterTemplate"}
+ ];
this.init2 = this.init.bindAsEventListener(this);
+// this.init()
},
init: function(){
+
+ ClientUI.controls.grid.ScrollableGrid.parentClass.constructor().call(this,
this.client_id, this.dataModel, this.templates);
- this.dataModel = new ClientUI.controls.grid.FakeArrayDataModel(this.rows_count,
this.columns_count, this.client_id);
-
- var templates = [
- {pane: GridLayout_Enum.HEADER, ref: this.client_id +"_" +
"GridHeaderTemplate"},
- {pane: GridLayout_Enum.BODY, ref: this.client_id +"_" +
"GridBodyTemplate"},
- {pane: GridLayout_Enum.FOOTER, ref: this.client_id +"_" +
"GridFooterTemplate"}
- ];
-
- // create the Grid
- this.grid = new ClientUI.controls.grid.Grid(this.client_id, this.dataModel, templates,
- {
- showIndexColumn: false,
- indexColumnWidth: 40
- }
- );
-
var progress = new ClientUI.common.box.SplashBox(this.splash_id, null, 300, true);
-
- this.grid.setProgressCtrl(progress);
- Event.observe(this.grid.eventOnSort, "on sort",
this.onSorted.bindAsEventListener(this));
+ this.setProgressCtrl(progress);
+ Event.observe(this.eventOnSort, "on sort",
this.onSorted.bindAsEventListener(this));
},
onSortComplete : function(request, event, data){
var options = request.getJSON("options");
- AjaxUpdater.updateRows(options,request, this.grid, this.client_id);
+ AjaxUpdater.updateRows(options,request, this, this.client_id);
},
onScrollComplete : function(request, event, data){
var options = this.dataModel.getCurrentOptions();
- AjaxUpdater.updateRows(options,request,this.grid,this.client_id);
+ AjaxUpdater.updateRows(options,request,this,this.client_id);
},
onSorted: function(sortEvent) {