The changelog for the SQLite Editor

This page is where you can read about the changes to the SQLite Editor and find out what has changed.

A couple of API functions have been added: editor_deselectrow() and editor_isselected().

You can now use * as a column name wildcard with the columns_tooltips property.

There's now a GitHub repository for the SQlite Editor source code that you can follow if you want to. There's not exactly much to look at there at the moment - but it will grow in time.

The sql_add option is now called sql_insert to bring it into line with the other sql_* options.

Previously, when you deleted one or more rows, you would select the rows and press the delete button, or when you added a new row you would press the add button, and you would then see a native JavaScript confirmation dialog popup asking you to confirm the action.

Now though, instead of those ugly native JavaScript confirmation dialogs, there are some nicer-looking confirmation messages which use the editor_modal.show() API function. This function is a cut-down version of the RGraph Modal Dialog.

These new HTML-based dialogs are far easier on the eye and can show a wide range of HTML - not just plain text.

Added checkbox and radio button support to editing. These operate similarly to select dropdowns and you need to also specify either the editable_types_radio_options or the editable_types_checkbox_options to give the various radio buttons or checkboxes.

Added the option editable_view_only to change the edit interface into a "detail view" for a particular record without the bility to make any changes to it.

Added the option editable_event option which allows you to specify the event that triggers the editing popup dialog. By default this is dblclick but you can change it to click for touch devices which would work better. Other events may work too (eg mouseover), but they don't make a whole lot of sense.

Added the new editing property editable_callback which allows you to give a PHP function that's called just before the data is saved to the database. When using the editor to manage passwords, this will allow you to hash the password before it gets saved to the database.

To try and ensure that error messages get seen, the PHP session is now started as soon as you include the SQliteEditor.php library file - not just when you create an editor object.

Added support for range inputs. These are slider bars. You stipulate them in your configuration a little differently to other inputs and that's because you can specify the minimum, maximum and step values. What you specify looks like this:

'editable_types' => [
   'age' => 'range,min=0,max=50,step=2'
]

Added the checkboxes_radio option so that, instead of checkboxes, you can have radio buttons instead. This may be preferable if you only want a single row to be selectable at once.

This change may affect you: The default width of the main table used to be set to 100%. This has now been removed to help with responsiveness. If you want it though you can easily set it with the style property like this:
'style' => [
    'div.editor table {width: 100%;}'
]
Added a new property: paging_info_colspan. If your right most column is used for action links/buttons and the <th> for this column is styled differently, you might not want the paging numbers to appear over it. With this property you can specify how many columns that the cell containing the paging numbers spans. The examples/accounts.php demo (in the download archive) shows an example that uses this property.

The use of * is now supported in more properties. You can now use it in: columns_widths, editable, editable_types, search_columns, ordering_include, ordering_exclude, columns_callbacks and columns_escape.

Note that when data is POSTed back to the editor after an edit, if you handle the edit yourself by setting the sql_update option to a function then the columns that are POSTed aren't trimmed to the columns specified in the editable option. ALL of the POSTed data is passed to the callback function.

The editable_options option has been renamed to: editable_types_select_options

To try and improve how the editor works when there are multiple instances of it on the page all functions are now prefixed with a string thats unique to the instance. There are a few functions, however, that are made public with shorter names. You can see these on the API docs page.

The modal dialog that's used (for example, when you're editing a row) now sits inside a container div.

The editor_setpage() function is now usable to set the page number of the editor.

How editing data works has been completely overhauled and reimplemented. This means that you no longer double click a cell to edit the value - instead when you double click a cell you get a popup that shows you the row data with inputs for the editable cells. When done, you click the save button and the data is saved back to the database. AJAX is no longer used - instead this is now a regular form which does a normal POST to the page to save the data. This new interface should be more comfortable to use.

You can now stipulate that a column should use a textarea for editing as well as a select or the various types of text input (eg date/color/number). Support for other types of form input is planned including radio buttons, checkboxes, range inputs (sliders), password etc.

The editable_log_response and editable_callback_url properties have been removed.

The styles property, which allows you to add CSS to the page to control how the editor looks, has been renamed to be just style. There's some code that renames the property if you use the old name though so if you use styles it will work fine (for a while).

There's now an option to use a textarea for editing instead of a regular text input. You can specify this by setting the editable_types option to "textarea".

Also, if you have a column that has a large amount of text in it that throws out the layout of the table, you can curtail the column using a columns_callback function that cuts off the text if its longer than a certain length.

The editable_textarea.php demo shows this in action.

The generation of the query-string has been centralised to a single function. This makes it easier to update and, if necessary, change.

Fixed a bug where the row hover color wasn't being applied to all of the columns when the sql_delete and checkboxes option were both falsey.

When you delete items in the editor, the URL manipulation has been massaged so that spurious query-string crumbs are not added and the URL doesn't grow out-of-control.

The source code has been significantly updated by changing the prefix that many function names had - the prefix "sqliteeditor_" has been changed to "editor_" .The sqlite name has been removed from other places too - for example the query-string parameter names. So now there shouldn't be any trace of the sqliteeditor name in the code.

When the editable_callback_url option is used, the POST data that's sent to the server has been updated. The parameter names have now also been changed to "editor_" instead of "sqliteeditor_" and the id parameter is now called "editor_id". The "database_name" parameter has been removed.

There's now support for various HTML5 form control elements: date, datetime, time, number and color You can specify these by setting the editable_types property to the relevant type.

There's a new editable_types option which alows you to specify the type of HTML form input that you want to see when editing a cell. The various types include: text (the default), date, time, datetime, color, number and select. The editable_options option (which is used when you stipulate that an editable column is a select dropdown list) can take several formats, including a function, an array, a CSV string or an SQL query. The function option can be used when you need a different set of options for each entry in the table.

Rows can now be selected by clicking on the entire row - not just the checkbox in that row. There's now two functions: editor_selectrow() and editor_togglerow() which you can use to check or uncheck rows.

The ordering of the results is now case-insensitive by default. There's a new property, though, ordering_case which defaults to false and if you change this to true the ordering will be done in a case-sensitive manner. Remember though, that this does mean that you will see all of the upper-case entries before the lower-case entries.
The search has been updated to use the SQLite GLOB functionality instead of the LIKE functionality. This makes it a bit more versatile for you so you can search for data in a few more ways. You can read about the ways that you can search on the search functionality page.

You can now sort the data by clicking the column headers. You can click the header multiple times to cycle through ascending, descending and not sorted. If you use the callbacks to alter the output then the resulting sorting may be unpredictable.

There was some mixing of the styles property where it was called style (no 's') in some places. This has been rectified and the correct term, style, is what you should use.

A search was added that enables you to search within the results. Internally, a LIKE query is performed doing this style of match %word1% AND %word2% AND %word3% etc. The search-clause is added to your select query when the user performs a search.
This was the initial release of the SQLite Editor for PHP software. Read through the documentation - specifically the API documentation - to learn about the features that are available to you.