Migration Guide

Moving to Teryx from another widget framework? This guide covers the key differences and common migration patterns.

From ExtJS / Sencha

ExtJS and Teryx share similar widget concepts (grids, trees, forms, panels), but Teryx takes a lighter approach with no class system and no framework lock-in.

Key Differences

ConceptExtJSTeryx
Widget creationExt.create('Ext.grid.Panel', {...})grid('#target', {...})
Class systemExt.define() with inheritancePlain functions, no classes
Data bindingViewModel + data bindingExplicit API calls or xhtmlx data attributes
Event handlinglisteners: { click: fn }on('grid:click', fn) via event bus
Layout systemComplex layout managersCSS Grid/Flexbox + tx-row/tx-col
LicenseCommercial (GPLv3 for open source)MIT — free for all use

Grid Migration

// ExtJS
Ext.create('Ext.grid.Panel', {
  renderTo: 'my-grid',
  store: { type: 'ajax', url: '/api/users' },
  columns: [
    { text: 'Name', dataIndex: 'name', sortable: true },
    { text: 'Email', dataIndex: 'email' },
  ],
});

// Teryx equivalent
grid('#my-grid', {
  source: '/api/users',
  columns: [
    { field: 'name', label: 'Name', sortable: true },
    { field: 'email', label: 'Email' },
  ],
});

Form Migration

// ExtJS
Ext.create('Ext.form.Panel', {
  renderTo: 'my-form',
  items: [
    { xtype: 'textfield', fieldLabel: 'Name', name: 'name' },
    { xtype: 'textfield', fieldLabel: 'Email', name: 'email', vtype: 'email' },
  ],
  buttons: [{ text: 'Submit', handler: function() { ... } }],
});

// Teryx equivalent
form('#my-form', {
  fields: [
    { name: 'name', label: 'Name', required: true },
    { name: 'email', label: 'Email', type: 'email', required: true },
  ],
  submitLabel: 'Submit',
  onSubmit: function(data) { ... },
});

From jQuery UI

jQuery UI provides basic widgets (dialog, accordion, tabs). Teryx offers the same widgets with more features and no jQuery dependency.

Key Differences

ConceptjQuery UITeryx
DependencyRequires jQueryZero dependencies
Widget init$('#el').dialog({...})modal({...})
Data gridNot included (use DataTables)Built-in with sort/filter/pagination
ChartsNot includedBuilt-in SVG charts
TypeScriptCommunity @typesFirst-class TypeScript support

Dialog Migration

// jQuery UI
$('#dialog').dialog({ title: 'My Dialog', modal: true, width: 400 });

// Teryx equivalent
var m = modal({ title: 'My Dialog', content: '...', size: 'sm' });
m.open();

Tabs Migration

// jQuery UI
$('#tabs').tabs();

// Teryx equivalent
tabs('#tabs', {
  variant: 'underline',
  items: [
    { id: 'tab1', title: 'Tab 1', content: '...' },
    { id: 'tab2', title: 'Tab 2', content: '...' },
  ],
});

From AG Grid

AG Grid is a powerful data grid library. Teryx includes a comparable grid widget plus 44 other widgets in a single package.

Grid Comparison

FeatureAG GridTeryx Grid
SortingYesYes
FilteringYes (advanced)Yes
PaginationYesYes
Cell editingYesYes
Row groupingEnterpriseYes (included)
Frozen columnsYesYes
ExportEnterpriseYes (CSV, Excel, JSON, HTML)
Other widgetsGrid only45+ widgets included
LicenseMIT (Community) / CommercialMIT
// AG Grid
const gridOptions = {
  columnDefs: [
    { field: 'name', sortable: true },
    { field: 'email' },
  ],
  rowData: data,
};
new agGrid.Grid(document.querySelector('#grid'), gridOptions);

// Teryx equivalent
grid('#grid', {
  data: data,
  columns: [
    { field: 'name', label: 'Name', sortable: true },
    { field: 'email', label: 'Email' },
  ],
});

General Migration Tips

Need help migrating? Start a discussion on GitHub.