Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
web:grid2 [2019/08/23 13:33]
agcyphers [Notes]
web:grid2 [2019/12/12 23:03] (current)
agcyphers [Examples]
Line 16: Line 16:
 | ::: | Currency | | ::: | Currency |
 | ::: | Double | | ::: | Double |
 +| ::: | TimeWithSeconds |
 +| ::: | TimeWithoutSeconds |
 | FormatTypes | Text | | FormatTypes | Text |
 | ::: | LongText | | ::: | LongText |
Line 31: Line 33:
 | ::: | Tree | | ::: | Tree |
 | ::: | Double | | ::: | Double |
 +| ::: | TimeWithSeconds |
 +| ::: | TimeWithoutSeconds |
 | SelectionTypes | Row | | SelectionTypes | Row |
 | ::: | Cell | | ::: | Cell |
Line 43: Line 47:
 | CellClick( Row as GraffitiWebGridRow,​ Column as GraffitiWebGridColumn,​ pageX as Integer, pageY as Integer ) | Fired when the user clicks a cell. | | CellClick( Row as GraffitiWebGridRow,​ Column as GraffitiWebGridColumn,​ pageX as Integer, pageY as Integer ) | Fired when the user clicks a cell. |
 | CelDoubleClick( Row as GraffitiWebGridRow,​ Column as GraffitiWebGridColumn ) | Fired when the user double-clicks a cell. | | CelDoubleClick( Row as GraffitiWebGridRow,​ Column as GraffitiWebGridColumn ) | Fired when the user double-clicks a cell. |
 +| CellMouseEnter(row as GraffitiWebGridRow,​ column as GraffitiWebGridColumn) | Raised when the mouse enters a grid cell. |
 +| CellMouseExit(row as GraffitiWebGridRow,​ column as GraffitiWebGridColumn) | Raised when the mouse exits a grid cell. |
 | ColumnResized( Column as GraffitiWebGridColumn ) | Fired when a column is resized in the display by the user. | | ColumnResized( Column as GraffitiWebGridColumn ) | Fired when a column is resized in the display by the user. |
 | ColumnsReordered() | Fired when the columns are reordered by the end-user. Use methods to determine new order. | | ColumnsReordered() | Fired when the columns are reordered by the end-user. Use methods to determine new order. |
Line 48: Line 54:
 | EditBegin( Row as GraffitiWebGridRow,​ Column as GraffitiWebGridColumn ) | Raised when an edit operation has begun. | | EditBegin( Row as GraffitiWebGridRow,​ Column as GraffitiWebGridColumn ) | Raised when an edit operation has begun. |
 | EditEnd( Row as GraffitiWebGridRow,​ Column as GraffitiWebGridColumn ) | Raised when an edit operation has ended, either by saving or canceling. | | EditEnd( Row as GraffitiWebGridRow,​ Column as GraffitiWebGridColumn ) | Raised when an edit operation has ended, either by saving or canceling. |
 +| EditKeyPress(Row as GraffitiWebGridRow,​ _ | Raised when the user presses a key while editing. |
 +| Column as GraffitiWebGridColumn,​ _ | ::: |
 +| KeyCode as Integer, _ | ::: |
 +| AltKey as Boolean, _ | ::: |
 +| CtrlKey as Boolean, _ | ::: |
 +| ShiftKey as Boolean, _ | ::: |
 +| MetaKey as Boolean, _ | ::: |
 +| EditorValue as String) | ::: |
 | RowCollapsed( Row as GraffitiWebGridRow ) | Fired when a tree row is collapsed. Children should be removed at this point. | | RowCollapsed( Row as GraffitiWebGridRow ) | Fired when a tree row is collapsed. Children should be removed at this point. |
 | RowExpanded( Row as GraffitiWebGridRow ) | Fired when a tree row is expanded. Children should be added at this point. | | RowExpanded( Row as GraffitiWebGridRow ) | Fired when a tree row is expanded. Children should be added at this point. |
 | RowReordered( Row as GraffitiWebGridRow,​ oldIndex as Integer, newIndex as Integer ) | Fired when the user drag reorders a row. | | RowReordered( Row as GraffitiWebGridRow,​ oldIndex as Integer, newIndex as Integer ) | Fired when the user drag reorders a row. |
-| RowSelectionChanged() | Fired when the user changes the row selection. Use methods to determine new selection. | 
 | ScrollPositionChanged( X as Integer, Y as Integer ) | The user has scrolled the display. | | ScrollPositionChanged( X as Integer, Y as Integer ) | The user has scrolled the display. |
 +| SelectionChanged() | Fired when the user changes the row selection. Use methods to determine new selection. |
 | Sorted( ByColumn as GraffitiWebGridColumn,​ Ascending as Boolean ) | When the user changes the sort order of the display, after the rows have been sorted by the new sort order. | | Sorted( ByColumn as GraffitiWebGridColumn,​ Ascending as Boolean ) | When the user changes the sort order of the display, after the rows have been sorted by the new sort order. |
  
Line 147: Line 161:
 End Sub</​code>​ End Sub</​code>​
  
 +=== Retrieving Value from Selected Row ===
 +This is done by reading the SelectedRows array:
 +<code xojo>Sub SelectionChanged() Handles SelectionChanged
 +  if me.SelectedRows.Ubound >= 0 then
 +    dim selRow as GraffitiWebGridRow = me.SelectedRows(0)
 +    dim firstColumn as GraffitiWebGridColumn = me.Column(0)
 +    dim rowColumnValue as String = selRow.Cell( firstColumn )
 +    '// Do something with rowColumnValue here. Note that GraffitiWebGridRow.Cell
 +    ' ​  ​returns a variant which matches the data type of that column, so String
 +    ' ​  may not be the correct data type depending on what you're project is
 +    ' ​  ​doing.
 +  end if
 +  End Sub</​code>​
 ==== Notes ==== ==== Notes ====
 === Column Direct Modification === === Column Direct Modification ===
Line 171: Line 198:
  
 ==== Common Problems ==== ==== Common Problems ====
 +=== The grid doesn'​t scroll on Firefox for Android ===
 +Due to an incompatibility in Firefox for Android, the Grid's drag scrolling does not function. Attempts to rectify this have failed. For the time being you can workaround this by detecting the device and browser and adding only those rows that would be visible and using pagination.
 +
 +It is likely that this will be addressed soon either by an update to GraffitiWebGrid or a new release of the browser.
 +
 === Columns are rendered, but I don't see any rows! === === Columns are rendered, but I don't see any rows! ===
 Make sure that your row data matches up to your column IDs. Make sure that your row data matches up to your column IDs.