4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-grid-LockingView'>/**
19 </span> * @class Ext.grid.LockingView
20 * This class is used internally to provide a single interface when using
21 * a locking grid. Internally, the locking grid creates 2 separate grids,
22 * so this class is used to map calls appropriately.
25 Ext.define('Ext.grid.LockingView', {
28 observable: 'Ext.util.Observable'
31 eventRelayRe: /^(beforeitem|beforecontainer|item|container|cell)/,
33 constructor: function(config){
36 eventRe = me.eventRelayRe,
37 locked = config.locked.getView(),
38 normal = config.normal.getView(),
45 lockedGrid: config.locked,
46 normalGrid: config.normal,
49 me.mixins.observable.constructor.call(me, config);
52 events = locked.events;
53 for (event in events) {
54 if (events.hasOwnProperty(event) && eventRe.test(event)) {
55 eventNames.push(event);
58 me.relayEvents(locked, eventNames);
59 me.relayEvents(normal, eventNames);
63 itemmouseleave: me.onItemMouseLeave,
64 itemmouseenter: me.onItemMouseEnter
69 itemmouseleave: me.onItemMouseLeave,
70 itemmouseenter: me.onItemMouseEnter
74 getGridColumns: function() {
75 var cols = this.lockedGrid.headerCt.getGridColumns();
76 return cols.concat(this.normalGrid.headerCt.getGridColumns());
79 onItemMouseEnter: function(view, record){
81 locked = me.lockedView,
82 other = me.normalView,
86 if (view !== locked) {
89 item = other.getNode(record);
90 other.highlightItem(item);
94 onItemMouseLeave: function(view, record){
96 locked = me.lockedView,
97 other = me.normalView;
100 if (view !== locked) {
103 other.clearHighlight();
107 relayFn: function(name, args){
110 var view = this.lockedView;
111 view[name].apply(view, args || []);
112 view = this.normalView;
113 view[name].apply(view, args || []);
116 getSelectionModel: function(){
117 return this.panel.getSelectionModel();
120 getStore: function(){
121 return this.panel.store;
124 getNode: function(nodeInfo){
125 // default to the normal view
126 return this.normalView.getNode(nodeInfo);
129 getCell: function(record, column){
130 var view = this.lockedView,
134 if (view.getHeaderAtIndex(column) === -1) {
135 view = this.normalView;
138 row = view.getNode(record);
139 return Ext.fly(row).down(column.getCellSelector());
142 getRecord: function(node){
143 var result = this.lockedView.getRecord(node);
145 result = this.normalView.getRecord(node);
150 addElListener: function(eventName, fn, scope){
151 this.relayFn('addElListener', arguments);
154 refreshNode: function(){
155 this.relayFn('refreshNode', arguments);
159 this.relayFn('refresh', arguments);
162 bindStore: function(){
163 this.relayFn('bindStore', arguments);
166 addRowCls: function(){
167 this.relayFn('addRowCls', arguments);
170 removeRowCls: function(){
171 this.relayFn('removeRowCls', arguments);