📄 listgrid.js
字号:
"hoverStyle", "hoverOpacity", "hoverMoveWithMouse", "hoverByCell", "keepHoverActive", "cellHoverOutset", // empty message "showEmptyMessage", "emptyMessageStyle", "emptyMessageTableStyle", // special presentation of records "singleCellValueProperty", "isSeparatorProperty", // Focus things -- note no need to pass tabIndex through - this is handled when // we create the body / update the tabIndex on the parent "accessKey", "canFocus", "_useNativeTabIndex", "tableStyle", "baseStyle", "recordCustomStyleProperty", "showFocusOutline" ], // the following methods, when called on the LV, will call the same-named method on the // GridRenderer (this.body). _lv2GridMethods : [ // this makes it easier to override getCellStyle at the LV level, since you can call // these helpers as this.getCellStyleName() "getCellStyleName", "getCellStyleIndex", // checking table geometry "getRowTop", "getRowPageTop", "getRowSize", "getCellPageRect", //> @method listGrid.getVisibleRows // @include gridRenderer.getVisibleRows() // @visibility external //< "getVisibleRows", //> @method listGrid.getDrawnRows // @include gridRenderer.getDrawnRows() // @visibility external //< "getDrawnRows", // embedded components "addEmbeddedComponent", "removeEmbeddedComponent" ], // styling //> @method listGrid.getCellStyle() // @include gridRenderer.getCellStyle() // @see listGrid.getBaseStyle() //< //> @method listGrid.getCellCSSText() // @include gridRenderer.getCellCSSText() // @example addStyle //< // refresh //> @method listGrid.refreshCellStyle() // @include gridRenderer.refreshCellStyle() //< // events //> @method listGrid.cellOver() // @include gridRenderer.cellOver() //< //> @method listGrid.rowOver() // @include gridRenderer.rowOver() //< //> @method listGrid.cellOut() // @include gridRenderer.cellOut() //< //> @method listGrid.rowOut() // @include gridRenderer.rowOut() //< //> @method listGrid.cellHover() // @include gridRenderer.cellHover() //< //> @method listGrid.rowHover() // @include gridRenderer.rowHover() //< //> @method listGrid.cellHoverHTML() // @include gridRenderer.cellHoverHTML() //< //> @method listGrid.cellContextClick() // @include gridRenderer.cellContextClick() // @example cellClicks //< //> @method listGrid.rowContextClick() // @include gridRenderer.rowContextClick() // @example recordClicks //< //> @method listGrid.cellMouseDown() // @include gridRenderer.cellMouseDown() //< //> @method listGrid.rowMouseDown() // @include gridRenderer.rowMouseDown() //< //> @method listGrid.cellMouseUp() // @include gridRenderer.cellMouseUp() //< //> @method listGrid.rowMouseUp() // @include gridRenderer.rowMouseUp() //< //> @method listGrid.cellClick() // @include gridRenderer.cellClick() // @example cellClicks //< //> @method listGrid.cellDoubleClick() // @include gridRenderer.cellDoubleClick() // @example cellClicks //< // Geometry //> @method listGrid.getRowTop() // @include gridRenderer.getRowTop() //< //> @method listGrid.getRowPageTop() // @include gridRenderer.getRowPageTop() //< // the following methods, when called on the GridRenderer used as LV.body, call the same-named // method on the ListGrid instance itself _grid2LVMethods : [ "getTotalRows", "isEmpty", "cellIsEnabled", "willAcceptDrop", // passed scroll change notification through "scrolled", // native element naming "getTableElementId", "getRowElementId", "getCellElementId", // shouldFixRowHeight - enables us to override the ListGrid level 'fixedRecordHeights' // for individual rows "shouldFixRowHeight", "getEmptyMessage", "getCanHover", // bubble stopHover on the GR up to stopHover here. "stopHover" // NOTE: These methods pick up their parameters from the stringMethodRegistry on the // GridRenderer class. If expanding this list ensure that any methods that take parameters // are registered as stringMethods on that class ]});isc.ListGrid.addClassMethods({ makeBodyMethods : function (methodNames) { var funcTemplate = this._funcTemplate; if (funcTemplate == null) { funcTemplate = this._funcTemplate = [,"return this.grid.",,"(",,")"]; } var methods = {}; for (var i = 0; i < methodNames.length; i++) { var methodName = methodNames[i], argString = isc.GridRenderer.getArgString(methodName); if (isc.contains(argString, "colNum")) { // if there's a colNum argument, map it to the field index in the master funcTemplate[0] = "if (this.fields[colNum]) colNum = this.fields[colNum].masterIndex;" } else if (isc.isAn.emptyString(argString)) { // if there are no arguments, pass the body itself as a means of identifying // the calling body argString = "body"; funcTemplate[0] = "body = this;"; } else { funcTemplate[0] = null; } // create a function that routes a function call to the target object funcTemplate[2] = methodName; funcTemplate[4] = argString; var functionText = funcTemplate.join(isc.emptyString); //this.logWarn("for method: " + methodName + " with argString :" + argString + // " function text is: " + functionText); methods[methodName] = new Function(argString, functionText); } return methods; }, classInit : function () { // create functions to have methods on the ListGrid's body call methods on the ListGrid // itself. This is partly legacy support: the way to customize body rendering used to // be to install functions that controlled body rendering directly on the ListGrid // itself. // make certain grid methods appear on the LV for convenience, so you don't have to go // this.body.someGridMethod() this.addMethods(isc.ClassFactory.makePassthroughMethods( this._lv2GridMethods, "body")); // ---------------------------------------------------------------------------------------- // create methods that can be installed on the body to call methods on the LV itself, for: var passthroughMethods = {}; // - handlers (like cellOver) and overrides (like getCellCSSText) that we allow to be // defined on the LV but are really grid APIs var gridAPIs = isc.getKeys(isc.GridRenderer._gridAPIs), passthroughMethods = isc.ListGrid.makeBodyMethods(gridAPIs); // - methods the grid needs to fulfill as the drag/drop target, which are really implemented // on the LV isc.addProperties(passthroughMethods, isc.ListGrid.makeBodyMethods(this._grid2LVMethods)); this._passthroughMethods = passthroughMethods; // create methods on the ListGrid to act as Super implementations for per-instance // overrides of methods where we want to call the original GridRenderer implementation // as Super. var passBackMethods = {}, funcTemplate = ["if(this.body.__orig_",,")return this.body.__orig_",,"(",,")"], origPrefix = "__orig_", gridProto = isc.GridRenderer.getPrototype(); for (var i = 0; i < gridAPIs.length; i++) { var methodName = gridAPIs[i], argString = isc.GridRenderer.getArgString(methodName); if (isc.ListGrid.getInstanceProperty(methodName) == null) { funcTemplate[1] = funcTemplate[3] = methodName; funcTemplate[5] = argString passBackMethods[methodName] = new Function(argString, funcTemplate.join(isc.emptyString)); // XXX this would also work, but imposes another Super call penalty, and is // odd (call to Super from outside of the object) //"return this.body.Super('" + methodName + "', arguments);"); } gridProto[origPrefix + methodName] = gridProto[methodName]; } this._passBackMethods = passBackMethods; this.addMethods(passBackMethods); }});// add default properties to the classisc.ListGrid.addProperties( { //> @attr listGrid.styleName (CSSStyleName : "listGrid" : IRW) // Default CSS class // @group appearance // @visibility external //< styleName:"listGrid", //> @attr listGrid.data (List of ListGridRecord : null : IRW) // A List of ListGridRecord objects, specifying the data to be used to populate the // ListGrid. In ListGrids, the data array specifies rows. Note that ListGrids // automatically observe changes to the data List and redraw accordingly. // <p> // This property is settable directly only as part of a +link{ListGrid} constructor. If // you want to change the +link{ListGrid}'s data after initial creation, call // +link{listGrid.setData}. // <p> // This property will typically not be explicitly specified for databound ListGrids, where // the data is returned from the server via databound component methods such as // +link{fetchData()}. In this case the data objects will be set to a // +link{class:ResultSet,resultSet} rather than a simple array. // // @group data // @see ListGridRecord // @setter ListGrid.setData() // @visibility external // @example inlineData // @example localData //< // useCellRecords - Is our data model going to be one record per cell or one record per row? useCellRecords:false, //> @object ListGridRecord // A ListGridRecord is a JavaScript Object whose properties contain values for each // +link{ListGridField}. A ListGridRecord may have additional properties which affect the // record's appearance or behavior, or which hold data for use by custom logic or other, // related components. // <p> // For example a ListGrid that defines the following fields: // <pre> // fields : [ // {name: "field1"}, // {name: "field2"} // ], // </pre> // Might have the following data: // <pre>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -