📄 listgrid.js
字号:
// element values are set) lg.updateEditRow(lg.getEditRow()); if (lg._scrollCell != null) { lg.scrollCellIntoView(lg._scrollCell); delete lg._scrollCell; } }, // rerun ListGrid-level layout if the body's scrolling state changes, to allow sizing // the header appropriately layoutChildren : function (reason,a,b,c) { this.invokeSuper(null, "layoutChildren", reason,a,b,c); if (reason == "scrolling state changed") { if (this._rowHeightAnimation == null) { this.grid.layoutChildren("body scroll changed"); delete this._scrollbarChangeDuringAnimation; } else { this._scrollbarChangeDuringAnimation = true; } } }, // Override rowAnimationComplete to call layoutChildren on the ListGrid if // scrollbars were introduced or cleared during animation. _rowAnimationComplete : function () { this.Super("_rowAnimationComplete", arguments); if (this._scrollbarChangeDuringAnimation) { this.grid.layoutChildren("body scroll changed during animation"); delete this._scrollbarChangeDuringAnimation; } }, // Override moved to notify any edit form items that they have moved. moved : function (a,b,c,d) { this.invokeSuper(null, "moved", a,b,c,d); var lg = this.grid; if (lg._editorShowing) { lg._editRowForm.itemsMoved(); } }, parentMoved : function (a,b,c,d) { this.invokeSuper(null, "parentMoved", a,b,c,d); var lg = this.grid; if (lg._editorShowing) { lg._editRowForm.itemsMoved(); } }, // Override show() / hide() / parentVisibilityChanged() / clear() to notify the Edit // form items that they have been shown / hidden. setVisibility : function (newVisibility,b,c,d) { this.invokeSuper(null, "setVisibility", newVisibility,b,c,d); var lg = this.grid; if (lg._editorShowing) lg._editRowForm.itemsVisibilityChanged(); }, parentVisibilityChanged : function (newVisibility,b,c,d) { this.invokeSuper(null, "parentVisibilityChanged", newVisibility,b,c,d); var lg = this.grid; if (lg._editorShowing) lg._editRowForm.itemsVisibilityChanged(); }, clear : function () { this.Super("clear", arguments); var lg = this.grid; if (lg._editorShowing) { // If we're showing the editRow form, notify the items that they have // been removed from the DOM. lg._editItemsDrawingNotification(null, null, this); // Separate mechanism to notify the form that items are no longer visible. lg._editRowForm.itemsVisibilityChanged(); } }, // Our tab-index is handled by our parent - similarly use that to manage next/prev // tab-widgets. _getNextTabWidget : function (backwards) { return this.grid._getNextTabWidget(backwards); }, _setNextTabWidget : function () { }, // also notify the edit form items of z index change zIndexChanged : function () { this.Super("zIndexChanged", arguments); var lg = this.grid; // Note: setZIndex can be called at init time to convert "auto" to a numeric // zIndex - we therefore can't assume that we've been added to the ListGrid as // a child yet. if (lg && lg._editorShowing) lg._editRowForm.itemsZIndexChanged(); }, parentZIndexChanged : function (a,b,c,d) { this.invokeSuper(null, "zIndexChanged", a,b,c,d); var lg = this.grid; if (lg._editorShowing) lg._editRowForm.itemsZIndexChanged(); }, // Implement 'redrawFormItem()' - if one of the edit form items asks to redraw // we can simply refresh the cell rather than having the entire body redraw redrawFormItem : function (item, reason) { var lg = this.grid; if (lg && (item.form == lg._editRowForm)) { // determine which cell var row = lg.getEditRow(), col = lg.getColNum(item.getFieldName()); lg.refreshCell(row, col, false, true); } else return this.markForRedraw("Form Item Redraw " + (reason ? reason : isc.emptyString)); }, //>Animation // Override startRowAnimation - if doing a delayed redraw to kick off a row animation // to close an open folder, we need to temporarily open the folder again to get the // appropriate HTML for the animation rows. startRowAnimation : function (show, startRow, endRow, callback, speed, duration, effect, slideIn, delayed) { var shouldOpenFolder = (delayed && (this._openFolder != null)), tg = this.grid; if (shouldOpenFolder) { tg._suppressFolderToggleRedraw = true; tg.data.openFolder(this._openFolder); tg._suppressFolderToggleRedraw = null; } this.Super("startRowAnimation", arguments); if (shouldOpenFolder) { tg._suppressFolderToggleRedraw = true; tg.data.closeFolder(this._openFolder); tg._suppressFolderToggleRedraw = null; } delete this._openFolder; } //<Animation});isc.ListGrid.addClassProperties({ //> @type SortArrow // Do we display an arrow for the sorted field ? // @group sorting, appearance // @value "none" Don't show a sort arrow at all. // @value "corner" Display sort arrow in the upper-right corner (above the scrollbar) only. CORNER:"corner", // @value "field" Display sort arrow above each field header only. FIELD:"field", // @value "both" Display sort arrow above each field header AND in corner above scrollbar. //BOTH:"both", // NOTE: Canvas establishes this constant // @visibility external //< // NOTE: Canvas established the constant NONE ( == "none") //> @type DragDataAction // What do we do with data that's been dropped into another list? // @visibility external // @group drag // @value "none" Don't do anything, resulting in the same data being in both lists. // @value isc.ListGrid.COPY Copy the data leaving the original in our list. COPY:"copy", // @value isc.ListGrid.MOVE Remove the data from this list so it can be moved into the other list. MOVE:"move", //< // Backcompat only: deprecated for 5.5 release in favor of "copy" CLONE:"clone", // @value isc.ListGrid.CLONE Clone the data (so there is another copy), leaving the original in our list. // isc.ListGrid.AFTER, isc.ListGrid.BEFORE, isc.ListGrid.OVER // constants used when determining whether to drop before, after or over rows AFTER:"after", BEFORE:"before", OVER:"over", //> @type RowEndEditAction // While editing a ListGrid, what cell should we edit when the user attempts to navigate // into a cell past the end of an editable row, via a Tab keypress, or a programmatic // saveAndEditNextCell() call? // // @value "same" navigate to the first editable cell in the same record // @value "next" navigate to the first editable cell in the next record // @value "done" complete the edit. // @value "stop" Leave focus in the cell being edited (take no action) // // @visibility external // @group editing // @see ListGrid.rowEndEditAction // //< //> @type EnterKeyEditAction // What to do when a user hits enter while editing a cell // @value "done" end editing // @value "nextCell" edit the next editable cell in the record // @value "nextRow" edit the same field in the next editable record // @value "nextRowStart" edit the first editable cell in next editable record // // @group editing // @visibility external //< //> @type EscapeKeyEditAction // What to do if the user hits escape while editing a cell. // @value "cancel" cancels the current edit and discards edit values // @value "done" end editing // // @group editing // @visibility external //< //> @type EditCompletionEvent // What event / user interaction type caused cell editing to complete. // @visibility external // @group editing // // @value isc.ListGrid.CLICK_OUTSIDE User clicked outside editor during edit. // @value isc.ListGrid.CLICK User started editing another row by clicking on it // @value isc.ListGrid.DOUBLE_CLICK User started editing another row by double // clicking // @value isc.ListGrid.ENTER_KEYPRESS Enter pressed. // @value isc.ListGrid.ESCAPE_KEYPRESS User pressed Escape. // @value isc.ListGrid.UP_ARROW_KEYPRESS Up arrow key pressed. // @value isc.ListGrid.DOWN_ARROW_KEYPRESS down arrow key. // @value isc.ListGrid.TAB_KEYPRESS User pressed Tab. // @value isc.ListGrid.SHIFT_TAB_KEYPRESS User pressed Shift+Tab. // @value isc.ListGrid.EDIT_FIELD_CHANGE Edit moved to a different field (same row) // @value isc.ListGrid.PROGRAMMATIC Edit completed via explicit function call // @visibility external //< CLICK_OUTSIDE:"click_outside", CLICK:"click", DOUBLE_CLICK:"doubleClick", ENTER_KEYPRESS:"enter", ESCAPE_KEYPRESS:"escape", UP_ARROW_KEYPRESS:"arrow_up", DOWN_ARROW_KEYPRESS:"arrow_down", // left/right only used in conjunction with moveEditorOnArrow LEFT_ARROW_KEYPRESS:"arrow_left", RIGHT_ARROW_KEYPRESS:"arrow_right", TAB_KEYPRESS:"tab", SHIFT_TAB_KEYPRESS:"shift_tab", EDIT_FIELD_CHANGE:"field_change", EDIT_ROW_CHANGE:"row_change", PROGRAMMATIC:"programmatic", // Focus is not a valid edit completion event - focussing in the grid can start an edit // if editOnFocus is true but this should not kill an existing edit. FOCUS:"focus", // GridRenderer passthrough // -------------------------------------------------------------------------------------------- // the following properties, when set on the LV, are applied to the Grid _gridPassthroughProperties : [ // pass it a selection object (this enables selection behaviors) "selection", "selectionType", "canSelectCells", "canDragSelect", "canSelectOnRightMouse", // D&D "canDrag", "canAcceptDrop", "canDrop", // table geometry "autoFit", "wrapCells", "cellSpacing", "cellPadding", "cellHeight", "enforceVClipping", // incremental rendering // "showAllRecords" -> showAllRows done elsewhere "showAllColumns", "drawAheadRatio", "quickDrawAheadRatio", "scrollRedrawDelay", //>Animation // If we're doing a speed rather than duration based row animation allow the cap to // be specified on the ListGrid / TreeGrid // (Note that this is documented in the TreeGrid class). "animateRowsMaxTime", //<Animation //> @attr listGrid.fastCellUpdates (boolean: false : I) // @include gridRenderer.fastCellUpdates // @group performance //< "fastCellUpdates", // rollover "showRollOver", "useCellRollOvers", // hover "canHover", "showHover", "hoverDelay", "hoverWidth", "hoverHeight", "hoverAlign", "hoverVAlign",
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -