DevExpress.Web.ASPxGridView.Scripts.GridViewAPI.js
上传用户:lh8511
上传日期:2013-01-28
资源大小:7353k
文件大小:12k
源码类别:

ActiveX/DCOM/ATL

开发平台:

Visual C++

  1.  ASPxClientGridViewColumn=_aspxCreateClass(null,{constructor:function(id,index,fieldName){this.id=id;this.index=index;this.fieldName=fieldName;}});ASPxClientGridViewColumnCancelEventArgs=_aspxCreateClass(ASPxClientCancelEventArgs,{constructor:function(column){this.constructor.prototype.constructor.call(this,true);this.column=column;}});ASPxClientGridViewRowCancelEventArgs=_aspxCreateClass(ASPxClientCancelEventArgs,{constructor:function(visibleIndex){this.constructor.prototype.constructor.call(this,true);this.visibleIndex=visibleIndex;}});ASPxClientGridViewRowClickEventArgs=_aspxCreateClass(ASPxClientGridViewRowCancelEventArgs,{constructor:function(visibleIndex,htmlEvent){this.constructor.prototype.constructor.call(this,visibleIndex);this.htmlEvent=htmlEvent;}});ASPxClientGridViewContextMenuEventArgs=_aspxCreateClass(ASPxClientEventArgs,{constructor:function(objectType,index,htmlEvent){this.constructor.prototype.constructor.call(this);this.objectType=objectType;this.index=index;this.htmlEvent=htmlEvent;}});ASPxClientGridView.prototype.PerformCallback=function(args){if(!_aspxIsExists(args))args="";this.gridCallBack("CUSTOMCALLBACK|"+args);}
  2. ASPxClientGridView.prototype.GetValuesOnCustomCallback=function(args,onCallBack){this.gridFuncCallBack("CUSTOMVALUES|"+args,onCallBack);}
  3. ASPxClientGridView.prototype.GotoPage=function(pageIndex){this.gridCallBack("GOTOPAGE|"+pageIndex);}
  4. ASPxClientGridView.prototype.NextPage=function(){this.gridCallBack("NEXTPAGE");}
  5. ASPxClientGridView.prototype.PrevPage=function(){this.gridCallBack("PREVPAGE");}
  6. ASPxClientGridView.prototype.UnGroup=function(column){column=this._getColumnIndexByColumnObject(column);this.GroupBy(column,-1)}
  7. ASPxClientGridView.prototype.ExpandAll=function(){this.gridCallBack("EXPANDALL");}
  8. ASPxClientGridView.prototype.CollapseAll=function(){this.gridCallBack("COLLAPSEALL");}
  9. ASPxClientGridView.prototype.ExpandAllDetailRows=function(){this.gridCallBack("SHOWALLDETAIL");}
  10. ASPxClientGridView.prototype.CollapseAllDetailRows=function(){this.gridCallBack("HIDEALLDETAIL");}
  11. ASPxClientGridView.prototype.ExpandRow=function(visibleIndex,recursive){if(this.RaiseRowExpanding(visibleIndex))return;if(!_aspxIsExists(recursive))recursive=false;this.gridCallBack("EXPANDROW|"+visibleIndex+"|"+recursive);}
  12. ASPxClientGridView.prototype.CollapseRow=function(visibleIndex,recursive){if(this.RaiseRowCollapsing(visibleIndex))return;if(!_aspxIsExists(recursive))recursive=false;this.gridCallBack("COLLAPSEROW|"+visibleIndex+"|"+recursive);}
  13. ASPxClientGridView.prototype.ExpandDetailRow=function(visibleIndex){this.gridCallBack("SHOWDETAILROW|"+visibleIndex);}
  14. ASPxClientGridView.prototype.CollapseDetailRow=function(visibleIndex){this.gridCallBack("HIDEDETAILROW|"+visibleIndex);}
  15. ASPxClientGridView.prototype.StartEditRow=function(visibleIndex){this.gridCallBack("STARTEDIT|"+visibleIndex);}
  16. ASPxClientGridView.prototype.UpdateEdit=function(){this._updateEdit();}
  17. ASPxClientGridView.prototype.CancelEdit=function(){this.gridCallBack("CANCELEDIT");}
  18. ASPxClientGridView.prototype.AddNewRow=function(){this.gridCallBack("ADDNEWROW");}
  19. ASPxClientGridView.prototype.DeleteRow=function(visibleIndex){this.gridCallBack("DELETEROW|"+visibleIndex);}
  20. ASPxClientGridView.prototype.ApplyFilter=function(expression){if(!_aspxIsExists(expression))expression="";this.gridCallBack("APPLYFILTER|"+expression);}
  21. ASPxClientGridView.prototype.ClearFilter=function(){this.ApplyFilter();}
  22. ASPxClientGridView.prototype.AutoFilterByColumn=function(column,val){column=this._getColumnIndexByColumnObject(column);if(!_aspxIsExists(column))return;if(!_aspxIsExists(val))val="";if(val.length>255)val=val.substr(0,255);this.gridCallBack("APPLYCOLUMNFILTER|"+column+"|"+val);}
  23. ASPxClientGridView.prototype.GroupBy=function(column,groupIndex,sortOrder){if(this.RaiseColumnGrouping(this._getColumnObjectByArg(column)))return;column=this._getColumnIndexByColumnObject(column);if(!_aspxIsExists(groupIndex))groupIndex="";if(!_aspxIsExists(sortOrder))sortOrder="ASC";this.gridCallBack("GROUP|"+column+"|"+groupIndex+"|"+sortOrder);}
  24. ASPxClientGridView.prototype.SortBy=function(column,sortOrder,reset,sortIndex){if(this.RaiseColumnSorting(this._getColumnObjectByArg(column)))return;column=this._getColumnIndexByColumnObject(column);if(!_aspxIsExists(sortIndex))sortIndex="";if(!_aspxIsExists(sortOrder))sortOrder="";if(!_aspxIsExists(reset))reset=true;this.gridCallBack("SORT|"+column+"|"+sortIndex+"|"+sortOrder+"|"+reset);}
  25. ASPxClientGridView.prototype.MoveColumn=function(column,columnMoveTo,moveBefore,moveToGroup,moveFromGroup){if(!_aspxIsExists(column))return;if(!_aspxIsExists(columnMoveTo))columnMoveTo=-1;if(!_aspxIsExists(moveBefore))moveBefore=true;if(!_aspxIsExists(moveToGroup))moveToGroup=false;if(!_aspxIsExists(moveFromGroup))moveFromGroup=false;if(moveToGroup){if(this.RaiseColumnGrouping(this._getColumnObjectByArg(column)))return;}
  26. column=this._getColumnIndexByColumnObject(column);this.gridCallBack("COLUMNMOVE|"+column+"|"+columnMoveTo+"|"+moveBefore+"|"+moveToGroup+"|"+moveFromGroup);}
  27. ASPxClientGridView.prototype.GetFocusedRowIndex=function(){return this._getFocusedRowIndex();}
  28. ASPxClientGridView.prototype.SetFocusedRowIndex=function(visibleIndex){return this._setFocusedRowIndex(visibleIndex);}
  29. ASPxClientGridView.prototype.IsCustomizationWindowVisible=function(){var custWindow=this.GetCustomizationWindow();return custWindow!=null&&custWindow.IsVisible();}
  30. ASPxClientGridView.prototype.ShowCustomizationWindow=function(showAtElement){var custWindow=this.GetCustomizationWindow();if(!_aspxIsExists(showAtElement))showAtElement=this.GetMainTable();custWindow.ShowAtElement(showAtElement);}
  31. ASPxClientGridView.prototype.HideCustomizationWindow=function(){var custWindow=this.GetCustomizationWindow();if(custWindow!=null)custWindow.Hide();}
  32. ASPxClientGridView.prototype.SelectRows=function(visibleIndices,selected){if(!_aspxIsExists(selected))selected=true;if(!_aspxIsExists(visibleIndices)){selected=selected?"all":"unall";visibleIndices="|0";}else{var res="";if(_aspxIsFunction(visibleIndices.push)){for(var i=0;i<visibleIndices.length;i++){res=res+"|"+visibleIndices[i];}}else{res="|"+visibleIndices;}
  33. visibleIndices=res;}
  34. this.gridCallBack("SELECTROWS|"+selected+visibleIndices);}
  35. ASPxClientGridView.prototype.SelectRowsByKey=function(keys,selected){if(!_aspxIsExists(selected))selected=true;if(!_aspxIsExists(keys))return;var res="";if(_aspxIsFunction(keys.push)){for(var i=0;i<keys.length;i++){res=res+"|"+keys[i];}}else{res="|"+keys;}
  36. keys=res;this.gridCallBack("SELECTROWSKEY|"+selected+keys);}
  37. ASPxClientGridView.prototype.UnselectRowsByKey=function(keys){this.SelectRowsByKey(keys,false);}
  38. ASPxClientGridView.prototype.UnselectRows=function(visibleIndices){this.SelectRows(visibleIndices,false);}
  39. ASPxClientGridView.prototype.SelectRowOnPage=function(visibleIndex,selected){if(!_aspxIsExists(selected))selected=true;this.SelectRow(selected);}
  40. ASPxClientGridView.prototype.UnselectRowOnPage=function(visibleIndex){this.SelectRowOnPage(visibleIndex,false);}
  41. ASPxClientGridView.prototype.SelectAllRowsOnPage=function(selected){if(!_aspxIsExists(selected))selected=true;this._selectAllRowsOnPage(selected);}
  42. ASPxClientGridView.prototype.UnselectAllRowsOnPage=function(){this._selectAllRowsOnPage(false);}
  43. ASPxClientGridView.prototype.GetSelectedRowCount=function(){return this._getSelectedRowCount();}
  44. ASPxClientGridView.prototype.GetSelectedFieldValues=function(fieldNames,onCallBack){this.gridFuncCallBack("SELFIELDVALUES|"+fieldNames,onCallBack);}
  45. ASPxClientGridView.prototype.GetRowValues=function(visibleIndex,fieldNames,onCallBack){this.gridFuncCallBack("ROWVALUES|"+visibleIndex+"|"+fieldNames,onCallBack);}
  46. ASPxClientGridView.prototype.GetPageRowValues=function(fieldNames,onCallBack){this.gridFuncCallBack("PAGEROWVALUES|"+fieldNames,onCallBack);}
  47. ASPxClientGridView.prototype.GetColumnsCount=function(){return this._getColumnsCount();}
  48. ASPxClientGridView.prototype.GetColumn=function(index){return this._getColumn(index);}
  49. ASPxClientGridView.prototype.GetColumnById=function(id){return this._getColumnById(id);}
  50. ASPxClientGridView.prototype.GetColumnByField=function(fieldName){return this._getColumnByField(fieldName);}
  51. ASPxClientGridView.prototype.GetEditor=function(column){var columnObject=this._getColumnObjectByArg(column);return columnObject!=null?this.GetEditorByColumnIndex(columnObject.index):null;}
  52. ASPxClientGridView.prototype.GetEditValue=function(column){var editor=this.GetEditor(column);return editor!=null?editor.GetValue():null;}
  53. ASPxClientGridView.prototype.SetEditValue=function(column,value){var editor=this.GetEditor(column);if(editor!=null){editor.SetValue(value);}}
  54. ASPxClientGridView.prototype.RaiseSelectionChanged=function(){if(!this.SelectionChanged.IsEmpty()){var args=new ASPxClientEventArgs();this.SelectionChanged.FireEvent(this,args);}return false;}
  55. ASPxClientGridView.prototype.RaiseFocusedRowChanged=function(){if(!this.FocusedRowChanged.IsEmpty()){var args=new ASPxClientEventArgs();this.FocusedRowChanged.FireEvent(this,args);}return false;}
  56. ASPxClientGridView.prototype.RaiseColumnSorting=function(column){if(!this.ColumnSorting.IsEmpty()){var args=new ASPxClientGridViewColumnCancelEventArgs(column);this.ColumnSorting.FireEvent(this,args);return args.cancel;}return false;}
  57. ASPxClientGridView.prototype.RaiseColumnGrouping=function(column){if(!this.ColumnGrouping.IsEmpty()){var args=new ASPxClientGridViewColumnCancelEventArgs(column);this.ColumnGrouping.FireEvent(this,args);return args.cancel;}return false;}
  58. ASPxClientGridView.prototype.RaiseColumnStartDragging=function(column){if(!this.ColumnStartDragging.IsEmpty()){var args=new ASPxClientGridViewColumnCancelEventArgs(column);this.ColumnStartDragging.FireEvent(this,args);return args.cancel;}return false;}
  59. ASPxClientGridView.prototype.RaiseColumnResizing=function(column){if(!this.ColumnResizing.IsEmpty()){var args=new ASPxClientGridViewColumnCancelEventArgs(column);this.ColumnResizing.FireEvent(this,args);return args.cancel;}return false;}
  60. ASPxClientGridView.prototype.RaiseRowExpanding=function(visibleIndex){if(!this.RowExpanding.IsEmpty()){var args=new ASPxClientGridViewRowCancelEventArgs(visibleIndex);this.RowExpanding.FireEvent(this,args);return args.cancel;}return false;}
  61. ASPxClientGridView.prototype.RaiseRowCollapsing=function(visibleIndex){if(!this.RowCollapsing.IsEmpty()){var args=new ASPxClientGridViewRowCancelEventArgs(visibleIndex);this.RowCollapsing.FireEvent(this,args);return args.cancel;}return false;}
  62. ASPxClientGridView.prototype.RaiseRowClick=function(visibleIndex,htmlEvent){if(!this.RowClick.IsEmpty()){var args=new ASPxClientGridViewRowClickEventArgs(visibleIndex,htmlEvent);this.RowClick.FireEvent(this,args);return args.cancel;}return false;}
  63. ASPxClientGridView.prototype.RaiseRowDblClick=function(visibleIndex,htmlEvent){if(!this.RowDblClick.IsEmpty()){var args=new ASPxClientGridViewRowClickEventArgs(visibleIndex,htmlEvent);this.RowDblClick.FireEvent(this,args);return args.cancel;}return false;}
  64. ASPxClientGridView.prototype.RaiseContextMenu=function(objectType,index,htmlEvent){if(!this.ContextMenu.IsEmpty()){var args=new ASPxClientGridViewContextMenuEventArgs(objectType,index,htmlEvent);this.ContextMenu.FireEvent(this,args);return true;}return false;}
  65. ASPxClientGridView.prototype.RaiseCustomizationWindowCloseUp=function(){if(!this.CustomizationWindowCloseUp.IsEmpty()){var args=new ASPxClientEventArgs();this.CustomizationWindowCloseUp.FireEvent(this,args);}return false;}
  66. ASPxClientGridView.prototype.RaiseBeginCallback=function(command){if(!this.BeginCallback.IsEmpty()){var args=new ASPxClientCallbackEventArgs(command);this.BeginCallback.FireEvent(this,args);}}
  67. ASPxClientGridView.prototype.RaiseEndCallback=function(){if(!this.EndCallback.IsEmpty()){var args=new ASPxClientEventArgs();this.EndCallback.FireEvent(this,args);}}