Editing Tables

Please review the Getting Started, User Interface Basics, Tables and Table Windows and Big Data topics before proceeding with this topic.  

 

This topic discusses interactive editing of tables by editing cells in one record at a time.  Edits in tables can also be accomplished on many records at a time using a combination of the Select panel, to select the records to be edited, and the Transform panel, to apply edits using a very wide variety of transform templates.  Tables can also be edited using queries.

 

To create a new, blank table:

 

  1. Choose File - Create - New Table, or use the context menu in the Project pane.

  2. Specify a Name for the new table.

  3. Press the Edit Schema button and use the Schema dialog to add fields and indexes and computed fields as desired to the table.

  4. Press Create Table.

 

We can easily create tables as in the above, but most often the tables we work with are created as a result of importing or linking data, either tables or drawings or images, or they are created by SQL we write.

 

Edit the structure of a table, adding or deleting columns, indexes or constraints, using the Edit - Schema dialog.

Index Required

ico_nb_arrow_blue.pngTo be editable tables must have an index and they cannot be read-only.  If a table has a light gray background in all of the columns it is not editable.  Having an index is a good idea in any event because it makes work with tables faster and it enables facilities like interactive selection.    To add an index to a table that does not have an index, see the Add an Index to a Table topic.

 

Tables in Manifold usually will have an index but quite often they may be linked in from read-only data sources that do not allow any changes.  For example, we may be able to view tables in an Oracle or PostgreSQL database hosted on a remote server but it could be that the IT department in charge of that server does not allow us to make any changes to tables.

 

Manifold automatically creates an index as necessary when importing tables into a project from many spatial data sources used in GIS work, for example, when importing a drawing.   When we import data from  sophisticated non-spatial data formats, such as a database, we usually get a table with an index as well, since DBMS people routinely will include indices for performance in their native database systems.  Manifold of course will import and will utilize those indices along with the rest of the schema and data.   

 

But if we import a table from a simple "data only" format like CSV where indices do not occur, then Manifold will not automatically add an index, in respect of keeping the data exactly as is in the original form.  In that case when we pop open the table we will see it with gray background color that indicates it cannot be edited.    That is not a big deal since adding an index is trivially easy:  See the Adding an Index to a Table topic for the step by step procedure.   See the Notes at the end of this topic for other unusual situations when we might be surprised to see that a table is not editable.

 

i_table_parts_labeled.png

Interactive Editing

i_table_parts_cursor.pngWe can edit tables using dialogs and menu commands to do things like change the schema of a table, use SQL queries to alter the structure of tables and the data within them or we can edit tables interactively using mouse and keyboard within a table window.    This topic discusses interactive editing within a table window.    Interactive editing of tables usually only makes sense for relatively small tables as it is neither convenient nor realistic to edit tables by hand when they contain millions of records.

 

Table windows allow us to look into a table.  They provide interactive browsing capability by fetching data from the table to display.   When we interactively edit data shown in a table window, such as by double-clicking into a cell and changing the value, we are working with the table window as an intermediary to the table.   We can either make an immediate edit to a cell or, if desired, put the entire row into edit mode so that edits to cells are temporary until all edits to the entire row at once are committed.  That allows us to make changes in the window's data, one record at a time, before we decide to commit those changes to the table.

 

Default actions, such as clicking the Enter key to begin editing a cell, will apply to the current cell, which is marked by a dotted line box called the cursor

 

Tables use background colors to call out the status of different fields and records.   These visual cues also help editing.

 

 

Immediate Edits / Temporary Edits

Manifold provides two options for editing the contents of cells in tables:

 

 

 

Any changes we make to a record within a table window that are shown with blue background color are temporary until we command the table window, with a Ctrl-Enter or a click on the row handle, to commit those changes by dispatching them to the table.  Cells shown with blue background color have changes that can be abandoned.  Cells with normal, white background that have been edited have had their changes already committed to the table.

 

Add a new row to a table by double-clicking into the last row, marked with a * asterisk in the row handle, and adding info into cells.   Press Ctrl-Enter or click the row handle to commit the new record.  Adding a new record is always a provisionary edit.

Editing a cell (immediate):

  1. Double-click any cell to open it for editing.  

  2. Edit the cell as desired.  

  3. Press Esc to cancel editing or press Enter to finish editing the cell.  Done.

 

eg_editcell01_01a.png

 

Double-click into any cell to open it for editing.

 

eg_editcell01_02a.png

 

Edit the cell as desired and then press Enter.

 

eg_editcell01_05.png

Done.   Edits take effect immediately.  

Editing a cell (provisionary):

  1. Click the row handle for the record to mark it for editing.   A triangle pointer symbol will appear in the record's row handle to indicate that record is being edited.

  2. Edit the cell as desired.  Press Esc to cancel editing or press Enter to finish editing the cell. The cell background will change to blue to indicate it has been edited.

  3. Edit any other cells in the record as desired, pressing Enter to finish editing each cell.

  4. To commit the edits for the record, click the triangle pointer symbol in the record's row handle or press Ctrl-Enter.

  5. To abandon the edits, click on the row handle of any other record, double-click into the cell of any other record or press Ctrl-Backspace.  We can also right-click onto the record we have temporarily edited and choose Undo Changes.

 

eg_editcell01_01.png

 

Click onto the row handle for the record to be edited.

 

eg_editcell01_02.png

 

Edit the cell as desired and then press Enter.

 

eg_editcell01_06.png

 

The changes will be previewed in blue preview color.  Seeing a triangle pointer symbol in a record's row handle or seeing blue color in a record's cells tells us that edits have been made in that record which have not yet been committed.   We can commit the edits by pressing Ctrl-Enter or by clicking  the triangle pointer symbol in the record's row handle.  Edits made to a record are temporary until they are committed.  

 

If we want to abandon the edits we can right-click onto the record and choose Undo Changes, we can press Ctrl-Backspace, we can click on a different record's row handle or we can begin editing a different record by double-clicking into a cell, in which case all uncommitted prior changes will be discarded and the previously edited record will revert to the original, unedited content

 

eg_editcell01_05.png

 

Only one record at a time may be edited provisionally, but we can edit multiple fields in the same record before deciding to commit all previewed edits or abandoning them.  If we want to abandon previewed changes for only one field we can right-click onto that cell and choose Undo Changes.   This makes it possible to edit records where more than one field must be edited at the same time in order to satisfy constraints.  For example, a table of records representing travel information may require that the departure date for a hotel reservation be later in time than the arrival date for that reservation.

 

See the Example: Editing Records in a Table  topic for a step by step example of editing records.

 

NULLs

 

To manually set the value of a cell to <NULL>, right-click onto the cell and choose Delete.   

Adding New Records

If a table supports adding records the table window will display an editable, blank, template record at the end of the table, marked with an asterisk * character in the row handle.  To add a new record we edit the blank record, double-clicking into one of the record's cells to begin editing.

 

The asterisk * character in the row handle changes to a triangle icon in the row handle when we make edits to the blank, template record. We commit changes to the edited template record by clicking the triangle icon or by pressing Ctrl-Enter.  

 

Committing the changes will add a new record to the table, a new value for mfd_id will automatically appear in that field for the new record if that field is used, and a new, blank, template record marked with an asterisk * in the row handle will appear at the end of the table.

 

See the Example: Adding Records to a Table topic for a step by step example of adding records.

 

Copy, Cut, Paste

We can also insert records by pasting records that have been copied or cut from another table window to the Windows clipboard.  Pasting tables between tables assumes the same field names.  Values for read-only field names or computed fields are ignored when pasting.  

 

Pasting with Ctrl-V will not paste records that have the same mfd_id value as existing records.  Pasting with Shift-Ctrl-V calls up the Paste dialog for more extensive pasting options.   Choose ignore Field in the Paste dialog to ignore mfd_id values in the pasted records and thus automatically create new mfd_id values, avoiding any collisions in mfd_id values with existing records.

 

We can also create a new table in the project pane by pasting records copied or cut from a table window.

 

We can use the context menu on cells to right-click onto a cell, choose Copy and then right-click onto another cell and choose Paste.  See the Manifold Future - Future Tour Part 6 Cell Context Menu  video for examples.

 

Adding New Fields

If a table supports adding new fields we can do so right from a table window with no need to open the table's schema via Edit - Schema.  Tables that allow adding fields will be displayed with a blank, asterisk * field at the right of the table.  Clicking on the asterisk * column handle will launch the New Field dialog to allow us to add a field.  We can also launch the New Field dialog from the context menu launched by right-clicking the column head of an existing field.

 

See the Example: Add a Computed Field to a Table topic for a step by step example of adding a new field.

 

By default the New Field dialog lets us specify the name and the data type of the new field. We should, of course, set the field type to something sensible for the field we intend to add.  For example, if want to add a field with names of people and we accidentally choose a type of tile instead of the nearby nvarchar when we try to populate the field with text the result will be NULLs.  

 

Checking the Set field values box opens up an expression builder, somewhat similar to the query builder in the Command Window, that allows us to create an expression which will be automatically computed to set the value of that field.   Clicking Add Field will add the field to the table and then will populate that field for each record with values computed according to the expression.  

 

When using Set field values to create a computed field we see a live preview of the expression in the * field in the table window.  As we edit the expression Manifold will automatically compute it for the records shown in the table window and will display the resulting values.   The table window stays fully operational: the display can be scrolled, columns can be dragged left and right to be repositioned, we can edit existing records or add new records and so on.   When we press the Add Field button the computed values are committed to the field.

 

Manifold uses a background thread to compute the preview.   If computations for the preview are intensive, the previewed values for records that are queued for computation will be shown with gray background, switching to  normal background color when the values are computed.

 

By default, checking the Set field values to add field values based on an expression results in static values being added to that field for each record.  If we thereafter change one of the other field values that was used in the expression the value that was originally set will not change.  If we want automatic updates based on the expression we use the Add Computed Field button to add a computed field to the table.   Computed fields will on the fly calculate the specified expression to dynamically compute the value in the computed field.  

 

Table windows also allow us to edit the values for existing fields by choosing the Transform command in the context menu raised by right-clicking on the column head of an existing field.

No Undo after Edits are Committed

In provisionary editing, Manifold allows us to edit as many cells as we want in the same record and to then abandon those edits.   That provides a level of "undo" not available in all database systems.   In addition, while we are editing a record, after we have double-clicked into the cell but before we have pressed Enter to close the editing session in that cell, we can right-click into the cell and choose Undo to abandon edits made since we double-clicked into the cell.

 

Important: Either in immediate cell editing or once an edit to a record has been committed with a Ctrl-Enter in provisionary editing, the edit is permanent and cannot be undone. Like almost all database systems there is no "undo" after edits to records have been committed in Manifold.  

 

If we want to browse data sets without any risk of making permanent edits we can do so by checking the Open as read-only option box in the New Data Source dialog to add them as a read-only data source.

Context Menu on Cells

Right-clicking onto a cell calls up a context menu that automates many common tasks:

 

Add Filter

See the Filters topic.   One-click process to add a filter based on the value of that cell.

Undo Changes

Enabled only for all cells shown in blue preview color.  Abandon edits that are being previewed.

Copy

Copy the entire contents of the cell to the clipboard.  This is a useful way to copy lengthy text from a cell onto the clipboard without having to open the cell for editing.

Paste

Paste the contents of the clipboard into the cell.

Delete

Delete the contents of the cell, which creates a <NULL> value in the cell.

Edit

Enabled for cells containing text.  Launch the entire text contents of the cell in an Edit dialog.

Copy to Selection

Appears for selected records.  Copy the value of this cell to that field for all selected records.   Keyboard shortcut: Ctrl-F2

Ctrl-F2

Copy contents of the selected, context cell to all selected records. A keyboard shortcut for Copy to Selection.

 

The right-click context menu on a cell is a fast and convenient way of copying the entire contents of one cell into another cell.  See the Manifold Future - Future Tour Part 6 Cell Context Menu video for an example.

Controls Reference for Tables

<gray background>

Values shown with gray background are read-only and cannot be edited.

Enter

Ctrl-Enter

Enter to open the current cell for editing, or double-click into a cell.  Enter closes the cell for editing, leaving it in blue preview color until a Ctrl-Enter commits the change.

Esc

When edits are in process, pressing Esc closes the editing session without applying changes.  

Ctrl-backspace

Abandon all edits for all cells shown in blue preview color.   To abandon edits for only one cell shown in blue preview color, right-click onto that cell and choose Undo Changes.

Ctrl-click

Ctrl-click anywhere in a row to toggle the selection status of that record.

Ctrl-click-and-drag

Ctrl-click and drag a selection box to add to the selection all rows that are touched by or are within the box.

Alt-Ctrl-click-and-drag

Alt-Ctrl-click and drag an unselection box to remove from the selection all rows that are touched by or are within the box.

Arrow Keys

Move current cell cursor up / down / left / right.

Home

Move current cell cursor all the way to the left-most column.

End

Move current cell cursor all the way to the right-most column.

Ctrl-Home

Move current cell cursor to the top of the table.

Ctrl-End

Move current cell cursor to the bottom of the table.

Page Up

Page Down

Move current cell cursor up or down one display page's worth.

Cell context menu

Right-clicking onto a table cell calls up  a context menu:

 

  • Filter - One-click choice of filters to filter the table based on that cell's value.

  • Undo Changes - Appears if a cell has been edited and is still in the preview state with blue color background.  Abandons the edit.

  • Copy - Copy the contents of the cell into the Clipboard.

  • Paste - Paste the contents of the Clipboard into the cell.

  • Delete - Delete the value in the cell, resulting in <NULL>

  • Edit - Open the contents of the cell in a larger text pane.

Scroll bar

A vertical scroll bar appears when there are more records than can fit into the window.   Scrolling the display does not move the current cell cursor.

Scroll bar context menu

Right-clicking onto the scroll bar calls up a context menu:

 

  • Scroll Here - Drag the scroll bar handle to the spot right-clicked and scroll the display accordingly.

  • Top - Scroll the display to the top.

  • Bottom - Scroll the display to the bottom.

  • Page Up - Scroll the display up one page.

  • Page Down - Scroll the display down one page.

  • Scroll Up - Scroll the display up one row.

  • Scroll Down - Scroll the display down one row.

Context Menu when Editing Text

While editing a text value in a cell or within the Edit dialog, a right click calls up the following context menu:

 

Undo

Undo changes made so far in the editing session.  The ability to undo goes away as soon as we close the editing session.

Cut

Copy highlighted text to the clipboard and delete the highlighted text.

Copy

Copy highlighted text to the clipboard.

Paste

Paste text contents of the clipboard.

Delete

Delete highlighted text.

Select All

Equivalent to Ctrl-A.  Highlight all text.

Right to Left Reading order

Display text right-aligned in order suitable for alphabets reading right to left.  

Show Unicode control characters

Display glyphs at the locations of otherwise invisible Unicode control characters.

Insert Unicode control character

Insert a Unicode control character at the location that was right-clicked, by choosing from the long list of available characters in the list that appears.  Unicode control characters guide the display of Unicode text for Unicode-aware applications.

Open / Close IME

Turn on or off Manifold's built in, Microsoft-compatible, Input Method Editor (IME) facility.   IME works with IME-aware Microsoft languages that have been installed on our computer to enable entry of non-English languages, primarily various Asian languages.

Reconversion

Enabled when we right-click on highlighted text that was entered using the IME facility.  Allows choice of a different conversion, for example, using katakana or kanji instead of hiragana text in Japanese.   See the example topic noted below.

 

For examples of use, including IME and Reconversion, see the Example: Edit Attributes, Larger Text, IME for Asian Languages topic.

 

Copy to Selection

The Copy to Selection command allows copying the value within a selected cell to that field in all selected records.

 

eg_copy_to_selection01_01.png

 

In the Products table we have selected all products with a Unit Price between 18 and 22 inclusive.   We want to set the Unit Price for all selected records to 20.  We Right-click on a cell that has 20 as the Unit Price.

 

eg_copy_to_selection01_02.png

 

In the context menu that pops open we choose Copy to Selection.

 

eg_copy_to_selection01_03.png

 

Instantly, the value 20 is copied into the Unit Price cells for all selected records.

 

The keyboard shortcut of Ctrl-F2, copies the value of the cell designated by the cursor to all selected records.

 

eg_copy_to_selection01_04.png

 

Suppose the table cursor is on a cell with a Unit Price of 18.   Press Ctrl-F2.

 

eg_copy_to_selection01_05.png

 

That instantly copies the value of 18 into the Unit Price cell of all selected records.

 

 

tech_ravi_sm.pngOne More Thing...

Tech tip: Have we mentioned that tables are editable available only if there is btree or similar index in a table?   See the Adding an Index to a Table topic.

Notes

How to tell why a table is not editable?  - Gray background in all of the fields of a table indicates all fields are read-only.  There are three reasons why all of the fields may be read-only:

 

 

Data sources might be read-only because they were created with the Open as read-only option box checked in the New Data Source dialog.  However, some tables brought into Manifold from an external data source may be read-only because of access permissions or other security controls on the database in use, as a result of permissions or policies in the operating system or limitations of the connection to a remote database.

 

Deletions are Confirmed - Deleting records in a table window displays a confirmation dialog. The default button in the confirmation dialog is set to Cancel.  If we do not want to see the confirmation dialog, we can check the Never show this again box.  That will remove the confirmation dialog for deleting frames in layouts, for deleting objects in drawing layers, for deleting labels, and for deleting records in tables.    Another way to eliminate the confirmation dialog is to uncheck the Confirm deleting records box in the Tools - Options dialog.  

 

How to edit more than one record at a time?  - To edit more than one record at a time we can use queries. We can also use the Copy to Selection feature, as described in this topic.

 

Copy to Selection - Copy to Selection is so fast that normally it is instant; however, when doing big Copy to Selection in tables within data sources that are connected through slow communications links or which are slow data sources, there might be time for a progress dialog to appear, which reports progress of the operation and allows it to be canceled, the data source permitting.   The total time required for Copy to Selection is logged in the Log Window.  

 

Copy to Selection and Delete commands disabled - Table windows will disable Copy to Selection and Delete commands for values in a field that belongs to an index used by the table as a key.  

 

Editing Fields with Long Text - To edit fields with long text we use the Edit dialog, as seen in the Example: Edit Attributes and Move a Point and the Example: Edit Attributes, Larger Text, IME for Asian Languages topics.  Those examples use the Record panel but editing cells with long text in tables is exactly the same.

 

Unicode and Other Languages - For advanced Unicode editing and entry of various languages Manifold's cell editing in tables is fully Input Method Editor (IME) enabled.  See the Example: Edit Attributes, Larger Text, IME for Asian Languages topic.

 

See Also

Getting Started

 

User Interface Basics

 

Copy and Paste between Drawings

 

Tables

 

Data Types

 

Adding an Index to a Table

 

Table Windows and Big Data

 

Examples - Do not miss!  Browse through the many examples for step by step tutorials.

 

Example: Closing without Saving - An example that shows how File - Close without saving the project can affect local tables and components differently from those saved already into a data source, such as an .mdb file database.

 

Example: Editing Records in a Table

 

Example: Adding Records to a Table

 

Example: Add a Computed Field to a Table

 

 

Example: Edit Attributes and Move a Point - We look at the attributes for a point in a drawing layer and edit one of the attributes using a more expanded Edit dialog.  We then move the point to a new location. Easy!

 

Example: Edit Attributes, Larger Text, IME for Asian Languages - A tour showing how to edit attributes in a drawing using the Record panel Values tab and the expanded Edit dialog, including advanced Unicode facilities and use of the built in Input Method Editor (IME) to input text in Japanese language.

Videos

Manifold 9 - Copy to Selection - A short video showing how to copy the same, desired value to fields in all selected records.  This is a great way to make changes to many records at once in a table.  This technique is a life saver when making edits to tables.  Works in the free Viewer, too.

 

The following videos show use of the Record panel, but the editing moves they show are identical when applied to editing cells within tables.

 

Manifold Future - Future Tour Part 4 Edit Attributes, Move a Point - We use Manifold Future to see how to view attributes of objects in drawings, including use of the new Edit dialog to view long, multi-paragraph text fields.  We edit fields and see how easy it is to preview edits and either accept them or abandon them. We switch to editing the geometry of objects in a drawing, viewing the coordinate locations and using mouse moves to reposition points. We edit the location of a point to correct an error in a drawing, using Google Satellite view to provide context for the correction.  Fast and easy, with previews all the way!

 

Manifold Future - Future Tour Part 5 Unicode Attributes and IME -  We take a tour through Manifold Future attribute editing, showing how to edit attributes in a drawing using the Record panel Values

tab and the expanded Edit dialog, including advanced Unicode facilities and use of the built in Input Method Editor (IME) to input text in Japanese language.

 

Manifold Future - Future Tour Part 6 Cell Context Menu - A short video showing a fast and easy way to copy between cells in tables using the context menu.  Also... one step undo of pending changes,  setting the value of a cell to NULL and more. The context menu on cells is such a simple thing but it makes repetitive editing of tables much faster and easier.