From bf9051cac2f09a25952fafbda97a95b2f39e9eae Mon Sep 17 00:00:00 2001 From: Igor Kriklivetc Date: Thu, 3 Sep 2015 11:51:26 +0300 Subject: [PATCH] Tests updated --- devextreme/dx.devextreme-tests.ts | 123 +++++++++++++----------------- 1 file changed, 54 insertions(+), 69 deletions(-) diff --git a/devextreme/dx.devextreme-tests.ts b/devextreme/dx.devextreme-tests.ts index ef147c2c6..2aad878f1 100644 --- a/devextreme/dx.devextreme-tests.ts +++ b/devextreme/dx.devextreme-tests.ts @@ -2,12 +2,12 @@ module Tests.ui { var dataGridOptions: DevExpress.ui.dxDataGridOptions = { - activeStateEnabled: true, - allowColumnReordering: true, - allowColumnResizing: true, - onCellClick: function () { }, - cellHintEnabled: true, - columnAutoWidth: true, + activeStateEnabled: true, + allowColumnReordering: true, + allowColumnResizing: true, + onCellClick: function () { }, + cellHintEnabled: true, + columnAutoWidth: true, columnChooser: { emptyPanelText: "Nothing is here", enabled: true, @@ -17,66 +17,51 @@ module Tests.ui { }, columns: [ { - text: '5 columns with custom css class', value: [ - { dataField: 'Processed', dataType: 'boolean', allowSorting: false }, - { dataField: 'CustomerID', cssClass: 'customCssClass' }, - 'OrderDate', - { dataField: 'Freight', validationRules: [{ type: "range", min: 1, max: 100 }] }, - { dataField: 'ShipName', validationRules: [{ type: 'required' }] }, - 'ShipCity'] - }, - { - text: 'with show editor always', value: [ - { dataField: 'Processed', dataType: 'boolean', allowSorting: false, showEditorAlways: true }, - { dataField: 'OrderDate', dataType: 'date', showEditorAlways: true }, - { dataField: 'CustomerID', showEditorAlways: true }, - { dataField: 'Freight', showEditorAlways: true }, - { dataField: 'ShipName', showEditorAlways: true }] - }, - { - text: 'custom template/edit/header template', value: [ - 'CustomerID', - 'OrderDate', - 'Freight', - { - dataField: 'ShipVia', - editCellTemplate: function (container: JQuery, options: { value: number }) { - container.addClass('dx-editor-cell'); - container.append($('
').dxSelectBox({ - value: options.value, - dataSource: [ - { ShipperID: 1, CompanyName: 'Speedy Express' }, - { ShipperID: 2, CompanyName: 'United Package' }, - { ShipperID: 3, CompanyName: 'Federal Shipping' } - ], - valueExpr: 'ShipperID', - displayExpr: 'CompanyName' - })); - }, - cellTemplate: function (container: JQuery, options: { value: number }) { - container.text(String(options.value)); - }, - headerCellTemplate: function (container: JQuery, options: { headerCaption: string }) { - container.append($('
').css({ border: '1px solid red' }).text(options.headerCaption)); - } - }, - 'ShipName', - 'ShipCity'] - }, - { text: 'none', value: '' }, - { - text: 'custom template/header hogan template', value: [ - 'CustomerID', - 'OrderDate', - 'Freight', - { - dataField: 'ShipVia', - cellTemplate: '#hoganColumnTemplate', - headerCellTemplate: $('#hoganHeaderColumnTemplate') - }, - 'ShipName', - 'ShipCity'] - }], + alignment: "center", + allowFixing: true, + allowEditing: true, + allowFiltering: true, + allowGrouping: true, + allowHiding: true, + allowReordering: true, + allowResizing: true, + allowSearch: true, + allowSorting: true, + autoExpandGroup: true, + calculateCellValue: function(rowData: Object) { return "test-value"; }, + calculateFilterExpression: function(filterValue: any, selectedFilterOperation: string) { return []; }, + caption: "Test column", + cellTemplate: function(container: JQuery, options: Object) { $("Template").appendTo(container); }, + cssClass: "test-ccs-class-name", + customizeText: function(cellInfo: { value: any, valueText: string; }) { return "New text" }, + dataField: "Test", + dataType: "string", + encodeHtml: true, + falseText: "FALSE", + filterOperations: ["contains", "notcontains"], + filterType: "exclude", + filterValue: "Test-filter-value", + fixed: true, + fixedPosition: "right", + groupIndex: 0, + lookup: { + allowClearing: true, + dataSource: ["first", "second"], + displayExpr: "this", + valueExpr: "this" + }, + name: "test-column-name", + showEditorAlways: true, + showInColumnChooser: true, + showWhenGrouped:true, + sortIndex: 1, + sortOrder: "desc", + trueText: "TRUE", + visible: true, + visibleIndex: 0, + width: "100%" + } + ], customizeColumns: function (columns) { var i: number; for (i = 0; i < columns.length; i++) { @@ -118,10 +103,10 @@ module Tests.ui { if (columns[i].dataField === 'ShipCity') { columns[i].editCellTemplate = function (container: JQuery, options: { value: string; setValue: Function }) { $('
').dxAutocomplete({ - items: ["Bern", "Lyon", "Lander"], + dataSource: ["Bern", "Lyon", "Lander"], value: options.value, - onValueChange: function (e:{ value: string }) { - options.setValue(e.value); + onValueChanged: function () { + options.setValue("test-value"); } }).appendTo(container); }