Tuesday 6th December, 2016

Editor 1.6.0 release notes

The Editor 1.6.0 is a major update to the Editor software package and includes a number of new headline features:

  • Templating forms for custom layouts
  • Local table editing without need to save to a server
  • Semantic UI integration
  • Support for compound keys
  • Oracle support for the PHP and .NET server-side libraries
  • Cancellable server-side events for PHP and .NET
  • Easier and more comprehensive join options for PHP and .NET
  • A new debug mode so you can see exactly what SQL Editor's server-side libraries are running.

There are many other smaller changes that make Editor easier to work with and of course a number of updates that address known issues. Please see the release notes below for full details of the changes and additions in this release.

Downloads

Downloads of specific versions of Editor are only available to license holders. Please see the download page for information about the current release version.

Release notes

New

  • Javascript
    • Disabled fields are styled to appear lowlighted (i.e. greyed out)
    • template option that can be used to define a form template to be used in the Editor form, allowing complex custom form layouts to be achieved with ease.
    • destroy() method that can be used to destroy an existing Editor instance.
    • Standalone editing now can read and write the field's value, optionally, from the data-editor-value attribute for a field, rather than using the HTML content as the value. The default (without the new attribute) is still to use the HTML content.
    • uploadXhrError event - triggered if the file upload from upload has an error return from the server.
    • A global form error returned by the server will now be shown below the field when inline editing.
    • The on* options for form-options (e.g. onBlur, onComplete, etc) all now can be defined as a function that will be executed when required. This provides the ability to perform additional logic in addition to calling API methods such as close().
    • Field type plug-ins now have the ability to control if a return key press will submit the form or not through the new optional canReturnSubmit field method. This can be useful for plug-ins which use the return key for item selection, inserting newlines, etc.
    • uploadXhrSuccess event that can be used to be notified when an upload is completed and also to modify the JSON returned by the server.
    • Local table editing. The ajax parameter used to be required in Editor, so it would know where to submit data. As of v1.6 this parameter is optional and if not provided Editor will operate in a local editing mode, updating a DataTable directly without server-side interaction. This can be particularly useful if you wish to use your own mechanism to submit the edited data to the server, rather than Editor's own Ajax submit method.
    • Append option for select, radio and checkbox field types when using their respective field().update() methods. This provides the ability to add to the current list, as well as the existing ability to entirely replace the existing list of options, which remains the default action.
    • fields.multiEditable option which can be used to disable editing of fields when multiple rows are selected, but still allow them to be edited when individual rows are being edited.
    • field().fieldInfo() and field().labelInfo() methods to allow the information elements to be dynamically updated after initialisation.
    • fields.message option to set the field's dynamic information message when initially created.
    • Improved REST support. HTTP status codes other than 2XX codes can now be processed as successful responses if they contain valid JSON. This is useful when integrating with a REST service were status codes such as 400 are used it indicate validation errors.
    • You can now specify your own success, error and complete methods in the ajax option and they will not overwrite or disable Editor's own methods. Your methods will be executed after Editor's.
    • Tab index for the Editor buttons can be specified via the buttons() method
    • editSingle and removeSingle button types which operate in exactly the same way as the edit and remove types, but are enabled only when a single row is selected. They are disabled when 0 or multiple rows are selected.
    • checkbox can now submit a predefined value when no checkboxes are selected in the field through the use of the new unselectedValue property. This makes checkbox fields very easy to use for a boolean input.
    • file() and files() methods. These are exactly the same as the methods that Editor adds to the DataTables API (which are now aliases of these methods), but are provided on the Editor instance. This is so file information can be used when standalone editing and a DataTable is not available.
    • files() and file() will now throw an error if a request is made for a file or table that doesn't exist. This is done to provide more information to the developer during the development process so allow errors to be corrected.
    • onFieldError option for the form-options object which gives the ability to disable the auto focus on error field
  • PHP
    • any() database method that can be used to determine if there are any rows that match a condition.
    • Editor->tryCatch() method that can disable the try/catch used in Editor->process(). Can be useful for debugging, but not production!
    • preGet and postGet events to compliment the existing events.
    • preCreate, preEdit and preRemove events can now all be cancelled by return false; from the event handlers.
    • Global validator method that can be specified using Editor->validator(). Provides hooks for security and global data validation whenever a request is made to the server through the Editor class.
    • Improved internationalisation support for numbers which use a comma as the decimal marker. Numeric validators now support an option to allow the decimal character to be specified as a comma (or any other character) and two new formatter methods to aid converting to and from a period for the database.
    • Oracle database support. This uses the oci_* PHP methods to connect to an Oracle database and provides all of the same features as the other databases that are supported.
    • Options class that can be used with Field->options(). This provides all of the functionality that Field->options() used before, but is much easier to read and understand as it uses class methods to configure how options are read from the database, rather than a list of parameters, the order for which is not always clear. The old style is still supported and will work with the 1.x libraries, but it is recommended the new style be used for all new work. The examples and documentation have been updated to reflect this.
    • Options->limit() method that can be used to limit the number of options shown in a select list.
    • Ability to specify a custom ordering when using field options.
    • Support for compound keys. Simply specify the columns that make up the compound key as an array of column names. Important this change has required that the Editor->pkey() method will now return an array if used as a getter, rather than a string (since multiple columns can be specified as the primary key column(s)).
    • Debug mode which can be enabled using ->debug(true). When enabled it will let you see the SQL statements that Editor is using and will return them in the JSON data as the property debugSql. This can be useful for understanding exactly how Editor is creating SQL based on its configuration and diagnosing any issues encountered. Obviously turn it off for production deployment!
    • Query->where_group() method accepts a callback function as the first parameter which will automatically group any conditions applied within it.
  • .NET
    • Options.Limit() method that can be used to limit the number of options shown in a select list.
    • Any() Database method that can be used to quickly determine if there are any rows that match a given condition.
    • PreGet and PostGet events to compliment the existing events.
    • preCreate, preEdit and preRemove server-side events are all now cancellable.
    • Global validator method that can be specified using Editor.Validator(). Provides hooks for security and global data validation whenever a request is made to the server through the Editor class.
    • Improved internationalisation support for numbers which use a comma as the decimal marker. Numeric validators now support an option to allow the culture name to be specified and two new formatter methods to aid converting to and from a period for the database.
    • Oracle database support!
    • Options class that can be used with Field.Options(). This provides all of the functionality that Field.Options() used before, but is much easier to read and understand as it uses class methods to configure how options are read from the database, rather than a list of parameters, the order for which is not always clear. The old style is still supported and will work with the 1.x libraries, but it is recommended the new style be used for all new work. The examples and documentation have been updated to reflect this.
    • Ability to specify a custom ordering when using field options.
    • Support for compound keys. Simply specify the columns that make up the compound key as an array of column names. Important this change has required that the Editor.Pkey() method will now return an array if used as a getter, rather than a string (since multiple columns can be specified as the primary key column(s)).
    • Debug mode which can be enabled using Editor.Debug(true). When enabled it will let you see the SQL statements that Editor is using and will return them in the JSON data as the property debugSql. This can be useful for understanding exactly how Editor is creating SQL based on its configuration and diagnosing any issues encountered. Obviously turn it off for production deployment!
    • Query.WhereGroup() method accepts a callback function as the first parameter which will automatically group any conditions applied within it.
    • Uploaded files can be saved to the database into binary field types using the new Upload.DbType.ContentBinary type.
  • Styling
    • Bootstrap integrations now use btn-primary for create and edit forms, and btn-danger for the delete form to draw addition to the main button.
    • Semantic UI integration for Editor
    • Bootstrap 4 integration for Editor. Bootstrap is still in alpha so this can't yet be considering to be complete in case anything changes in Bootstrap, but the basic integration is now in place.

Updates

  • Javascript
    • select now allows the form to be submitted when the return key is pressed and the select element has focus. Item selection can be performed using the keyboard with the space bar, which is common across platforms. This and other keyboard related notes are now maintained in the select documentation.
    • Processing display icon is now provided by CSS and a CSS animation rather than a gif. This allow allows reuse of the same style of loader to be used for both the main form editor, inline and bubble editing. Bootstrap, Foundation and jQuery UI integrations also utilise the processing display.
    • Envelope display control updated to no longer use images. A CSS box-shadow is now used instead.
    • jQuery UI date picker will no longer include the calender.png image by default. Use: dateImage: '/path/to/calander.png' to include the image.
    • The JSON response from a file upload now need only return the data for the newly uploaded files rather than all files as was required in 1.5.
  • PHP
    • The server will only return information about the newly uploaded file in the JSON response for an uploaded file
  • .NET
    • Oracle data access will now use the Oracle managed driver by default, which is much easier to deploy than the unmanaged driver.
    • The server will only return information about the newly uploaded file in the JSON response for an uploaded file
  • Styling
    • Improved layout for message, info and error messages in the DataTables styled form.
  • Examples
    • Include SQL required for compound key examples

Fixes

  • Javascript
    • When multi-row editing and a field is disabled, it shouldn't be possible to click on it to show the editing mode.
    • val() was incorrectly acting as a getter if an object was given as the first parameter. It should be a setter with the parameter names giving the field names and the values giving the field values.
    • Fields which are added to the form while editing data (not create or delete) would cause a Javascript error when checking for differences in values.
    • Complex field types that use objects or arrays as their value would incorrectly always be judged to be different in value from the edited value when submitting data, resulting in the field being submitted, even if submit: 'changed' was set.
    • Week number was not always correct to ISO8601 when used in the datetime field type.
    • Fields which use a floating panel for input such as the datetime input could have validation messages obstructed by the floating panel. Fields can now specify a errorMessage function that will be called when the field's error status changes, allowing it to display the message. This is now used for the datetime field type.
    • datetime would cause an error if used with clear()
    • Improved styling for Bootstrap 3/4 global error messages
    • If fields were defined with a name that was an integer value (which can readily be done if you are using a DOM data sourced table), the fields in the form would not correctly appear.
    • When using multiple instances of Editor with inline editing and Bootstrap, styling of text boxes would not be correctly applied for all tables other than the first instance
    • datetime didn't trigger a change event when the value was selected with a mouse, resulting in issues with using dependent() with date/time fields.
    • Don't overwrite the data property if legacyAjax is enabled and a data property is returned in the JSON from the server.
    • placeholderValue for select would not be submitted when provided but no value was selected by the end user.
    • Chrome rendering error (m53+) if lightbox is used and the field area scrolls. The form buttons would be hidden.
    • Bubble positioning could be set incorrectly if a jQuery instance was used as the modifier.
    • Row ID's which had characters used for specific meaning in CSS selectors would cause an error. For example an id with : would cause an error from jQuery's parser. The values are now correctly escaped.
    • Improve inline editing when passed a node
    • In standalone mode, when passed in an element as the identifier it is automatically used as the attachment point now rather than trying to look the attachment point up. This could cause an error if there are multiple elements that match the identifier (i.e. editing the same field in multiple locations on a page).
    • Datetime field might not be hidden when the Editor form was closed
    • "Today" indicator in datetime could incorrectly show the wrong date (±1) as today depending on the time the page was loaded and the timezone it was being used in.
  • PHP
    • Mjoin was failing if used with a key that was included in a left join and was not the primary key.
    • Query->where_group() when used and no condition was added inside of it would result in an SQL error.
    • Integration with SQLServer wouldn't correctly escape keywords when used as column names.
    • Mjoin options were not populated if ->name() was used to provide a different name from the database name.
    • Documentation for Field->set() reversed the boolean values for the method incorrectly.
  • .NET
    • Database tables were not correctly being escaped in queries
    • Mjoin was failing if used with a key that was included in a left join and was not the primary key.
    • When using MJoin with a link table and the link table was empty, options would not be listed.
    • Query.WhereGroup() when used and no condition was added inside of it would result in an SQL error.
    • DbType.ContentBinary should not be included in the JSON data returned to the client.
    • Integration with SQLServer wouldn't correctly escape keywords when used as column names.
    • Changes to allow DataTables.dll to build against .NET 4.0 (4.5 is the default). This is primarily a set of simple changes in how it uses reflection to get custom attributes using the 4.0 methods rather than the shortcuts provided in 4.5+.
    • Examples would incorrectly try to use a PHP script to extra information about the example's server-side script.
  • Documentation
    • buttons() documentation updated to reflect that you can set a class name for a button
    • preSubmit is cancellable. This should be (and now is) noted in the documentation.
    • Related links for a number of the i18n options were incorrect
    • Typo in postRemove documentation
    • table markdown error
    • Add note to display about options from the styling integration files
  • Examples
    • Don't show a server-side script for localStorage example
    • Inline editing example shouldn't sort on checkbox column by default
    • FixedColumns inline editing example didn't allow all columns to be editable.
    • Nicer styling for editing icon inline example
    • Don't pass the child node into Editor for inline editing when used with Responsive.
    • RowReorder example would have a sequence error if multiple rows were deleted.
    • Use PHP 5.3+ array syntax (rather than the 5.4+ shorthand)
    • Upload many example used wrong parameter name for noFileText option
    • RowReorder example would have a sequence error if multiple rows were deleted.
    • .NET time example wouldn't save PM times due to an incorrect formatter