Nuvolar_Scanner_Android.StorageLocationFoldEdit = function (params) { "use strict"; var viewModel = { viewShown: function (e) { $("#gridContainer").dxDataGrid({ dataSource: dataSourcePDARows, allowColumnReordering: true, allowColumnResizing: true, showColumnLines: true, showRowLines: true, rowAlternationEnabled: true, columnAutoWidth: true, height:450, columnChooser: { enabled: false }, //paging: { // pageSize: 10 //}, scrolling: { mode: 'infinite' }, //pager: { // showPageSizeSelector: true, // allowedPageSizes: [5, 10, 20] //}, columnFixing: { enabled: true }, selection: { mode: 'multiple', allowSelectAll: false }, //editing: { // //editEnabled: true, // editMode: 'row', // //insertEnabled: true, // removeEnabled: true //}, store: {key: "Oid"}, onRowRemoving: function(e) { var dataGrid = $('#gridContainer').dxDataGrid('instance'); alert(dataGrid.getSelectedRowsData()); e.cancel = true; //e.data.RecordStatus = 'Deleted'; //var rowIndex = e.component.getRowIndexByKey(e.key); //var $commandEditCell = e.component.getCellElement(rowIndex, "command:edit"); //$commandEditCell.empty(); //$commandEditCell.parent().addClass("deleted"); }, columns: [{ dataField: "Oid", visible: false, key:true}, { dataField: "QTT",caption:'M.',dataType:'number' }, { dataField: "ShortName", caption:'Megnevezés'}, { dataField: "Barcode", caption: 'Vonalkód' }, { dataField: "RowIndex", caption: 'S.', allowSorting: true, sortIndex: 1, sortOrder: 'desc', dataType: 'number' } ] }); SimpleQuery.UserName = username(); SimpleQuery.Password = password(); SimpleQuery.Database = database(); dataSourcePDARows = null; $("#gridContainer").dxDataGrid({ dataSource: dataSourcePDARows }) SimpleQuery.Query = 'DX_GetStoragePDACollectionRows_dxDataGrid;' + params.id; JSON_Text = JSON.stringify(SimpleQuery, null); $.getJSON(URL(), 'id='+JSON_Text, function (results) { dataSourcePDARows = JSON.parse(JSON.parse(results).Result); $("#gridContainer").dxDataGrid({dataSource: dataSourcePDARows}) } ).done(function () { //alert("second success"); }).fail(function (jqXHR, textStatus, errorThrown) { DevExpress.ui.notify("Kapcsolati hiba, próbálja meg újra!", "error", 2000); }); }, onEnterKeyBarcodeProducts: function (e) { SimpleQuery.UserName = username(); SimpleQuery.Password = password(); SimpleQuery.Database = database(); SimpleQuery.Query = 'DX_InsertStorageLocationFold_dxDataGrid;' + BarcodeProducts() + ';' + params.id + ';' + QTT() + ';' + BarcodeLocations(); JSON_Text = JSON.stringify(SimpleQuery, null); $.getJSON(URL(), 'id=' + JSON_Text, function (results) { Barcode(""); dataSourcePDARows = JSON.parse(JSON.parse(results).Result); $("#gridContainer").dxDataGrid({ dataSource: dataSourcePDARows }) $("#BarcodeTextProducts").dxTextBox("instance").focus(); } ).done(function () { }).fail(function (jqXHR, textStatus, errorThrown) { DevExpress.ui.notify("Kapcsolati hiba, próbálja meg újra!", "error", 2000); }); }, onEnterKeyBarcodeLocations: function (e) { $("#BarcodeTextProducts").dxTextBox("instance").focus(); }, removerows: function (e) { } }; return viewModel; };