diff --git a/app/Functions/datagrid-scripts.php b/app/Functions/datagrid-scripts.php index 8ad5d56..6a56573 100644 --- a/app/Functions/datagrid-scripts.php +++ b/app/Functions/datagrid-scripts.php @@ -1,278 +1,194 @@ - - - + + + - - - - - - -.css"> - - + + + + + + + "> + + - - + + - - - + + + - - td, + .dx-datagrid .dx-row>tr>td { + padding: 5px !important; + } + + .dx-editor-cell .dx-texteditor .dx-texteditor-input { + height: 16px; + } + + .dx-datagrid .dx-row-lines>td { + border-bottom: 1px solid #d2d2d2; + } + + - - toolbar: { - items: [ - "addRowButton", - "applyFilterButton", - "columnChooserButton", - "revertButton", - "saveButton", - "searchPanel", - "exportButton", - "groupPanel", - { - location: 'before', - widget: 'dxButton', - options: { - icon: 'filter', - text: '{{e2("Clear Filter")}}', - onClick: function(e) { - dataGrid.clearFilter(); - } - } - }, - ] - }, - paging: { - pageSize: , - }, - allowColumnResizing: true, - columnAutoWidth: true, - allowColumnReordering: true, - columnMinWidth: 150, - columnMaxWidth: 250, - columnResizingMode: "widget", - showColumnLines: true, - filterRow: { visible: true }, - searchPanel: { visible: true }, - columnFixing: { - enabled: true - }, - headerFilter: { - visible: true, - allowSearch: true, - }, - - loadPanel: { - enabled: true, - }, - - scrolling: { - mode: 'standart', - rowRenderingMode: 'infinite', - columnRenderingMode: 'infinite', - }, - hoverStateEnabled: true, - showBorders: true, - - remoteOperations: { - filtering: true, - paging: true, - sorting: true, - groupPaging: true, - grouping: true, - summary: true - }, - - - - onContextMenuPreparing: function(e) { - console.log("onContextMenuPreparing"); - console.log(e); - if (e.target == "content") { - if (!e.items) e.items = []; + + toolbar: { + items: [ + "addRowButton", + "applyFilterButton", + "columnChooserButton", + "revertButton", + "saveButton", + "searchPanel", + "exportButton", + "groupPanel", + { + location: 'before', + widget: 'dxButton', + options: { + icon: 'filter', + text: '{{e2("Clear Filter")}}', + onClick: function(e) { + dataGrid.clearFilter(); + } + } + }, + ] + }, + paging: { + pageSize: , + }, + allowColumnResizing: true, + columnAutoWidth: true, + allowColumnReordering: true, + columnMinWidth: 150, + columnMaxWidth: 250, + columnResizingMode: "widget", + showColumnLines: true, + filterRow: { visible: true }, + searchPanel: { visible: true }, + columnFixing: { + enabled: true + }, + headerFilter: { + visible: true, + allowSearch: true, + }, - @if(isAuth($id, "modify")) + loadPanel: { + enabled: true, + }, - e.items.push({ - text: "", - onItemClick: function(args) { - e.component.cellValue(e.rowIndex, e.columnIndex, null); - } - - }); + scrolling: { + mode: 'standart', + rowRenderingMode: 'infinite', + columnRenderingMode: 'infinite', + }, + hoverStateEnabled: true, + showBorders: true, - @endif + remoteOperations: { + filtering: true, + paging: true, + sorting: true, + groupPaging: true, + grouping: true, + summary: true + }, - @if(isAuth($id, "write")) - e.items.push({ - text: "", - onItemClick: function(args) { - $(".dx-icon-edit-button-addrow").trigger("click"); - selectedData = e.row.data; - - - } - - }); - @endif + onContextMenuPreparing: function(e) { + console.log("onContextMenuPreparing"); + console.log(e); + if (e.target == "content") { + if (!e.items) e.items = []; - @if(isAuth($id, "modify")) + @if(isAuth($id, "modify")) - e.items.push({ - text: "", - onItemClick: function(args) { - copyData = e.component.cellValue(e.rowIndex, e.columnIndex); - selectedColIndex = e.columnIndex; - selectedRowIndex = e.rowIndex; - console.log(e); - console.log(selectedColIndex); - console.log(selectedRowIndex); - Swal.fire(copyData, "", "success"); - - - } - - }); - - e.items.push({ - text: "", - onItemClick: function(args) { - - if(e.columnIndex != selectedColIndex) { - Swal.fire("", "", "error"); - } else { - for(var rowIndex = selectedRowIndex + 1; rowIndex<=e.rowIndex; rowIndex++) { - e.component.cellValue(rowIndex, e.columnIndex, copyData); - } - - } - - - - } - - }); + e.items.push({ + text: "", + onItemClick: function(args) { + e.component.cellValue(e.rowIndex, e.columnIndex, null); + } - @endif - } - }, - - onEditingStart(e) { - var focusedSelector = $("td.dx-focused"); - var rowIndex = dataGrid.option("focusedRowIndex"); - var colIndex = dataGrid.option("focusedColumnIndex"); - try { - var dataField = e.column.dataField; - var allEntries = JSON.parse(localStorage.getItem("originalData" + rowIndex + colIndex)) || []; - allEntries.push(e.data[dataField]); - localStorage.setItem("originalData" + rowIndex + colIndex, JSON.stringify(allEntries)); - } catch (error) { - - } - - - }, + }); - - onInitNewRow(e) { - - if(selectedData) { - e.data = selectedData; - selectedData = null; - - } - - }, - onRowInserting(e) { - logEvent('RowInserting'); - console.log(e); - }, + @endif - onRowInserted() { - // logEvent('RowInserted'); - }, - onRowUpdating() { - }, - onRowUpdated() { - // logEvent('RowUpdated'); - }, - onRowRemoving() { - // logEvent('RowRemoving'); - }, - onRowRemoved() { - // logEvent('RowRemoved'); - }, - onSaving() { - - }, - onInitialized() { - - $("#dataGrid td").on("click", function() { - logEvent("#dataGrid td"); - }); - }, - onRowClick: function(e) { - - /* - console.log("onRowClick"); - console.log(e); - selectedData = e.data; - selectedData.id = null; - if(e.rowType === "data") { - e.component.editRow(e.rowIndex); - } - - */ - }, - onSaved() { - - logEvent('Saving Success'); - }, - onEditCanceling() { - // logEvent('EditCanceling'); - }, - onEditCanceled() { - // logEvent('EditCanceled'); - }, - onFocusedRowChanging(e) { - // console.log(e); - }, - - - sorting: { - mode: "multiple" // or "multiple" | "none" - }, - - - ", + onItemClick: function(args) { + $(".dx-icon-edit-button-addrow").trigger("click"); + selectedData = e.row.data; + + + } + + }); + + @endif + + @if(isAuth($id, "modify")) + + e.items.push({ + text: "", + onItemClick: function(args) { + copyData = e.component.cellValue(e.rowIndex, e.columnIndex); + selectedColIndex = e.columnIndex; + selectedRowIndex = e.rowIndex; + console.log(e); + console.log(selectedColIndex); + console.log(selectedRowIndex); + Swal.fire(copyData, "", "success"); + + + } + + }); + + e.items.push({ + text: "", + onItemClick: function(args) { + + if(e.columnIndex != selectedColIndex) { + Swal.fire("", "", "error"); + } else { + for(var rowIndex = selectedRowIndex + 1; rowIndex<=e.rowIndex; rowIndex++) { e.component.cellValue(rowIndex, + e.columnIndex, copyData); } } } }); @endif } }, onEditingStart(e) { var focusedSelector=$("td.dx-focused"); var + rowIndex=dataGrid.option("focusedRowIndex"); var colIndex=dataGrid.option("focusedColumnIndex"); try { var + dataField=e.column.dataField; var allEntries=JSON.parse(localStorage.getItem("originalData" + rowIndex + colIndex)) || + []; allEntries.push(e.data[dataField]); localStorage.setItem("originalData" + rowIndex + colIndex, + JSON.stringify(allEntries)); } catch (error) { } }, onInitNewRow(e) { if(selectedData) { e.data=selectedData; + selectedData=null; } }, onRowInserting(e) { logEvent('RowInserting'); console.log(e); }, onRowInserted() { // + logEvent('RowInserted'); }, onRowUpdating() { }, onRowUpdated() { // logEvent('RowUpdated'); }, onRowRemoving() { // + logEvent('RowRemoving'); }, onRowRemoved() { // logEvent('RowRemoved'); }, onSaving() { }, onInitialized() { + $("#dataGrid td").on("click", function() { logEvent("#dataGrid td"); }); }, onRowClick: function(e) { /* + console.log("onRowClick"); console.log(e); selectedData=e.data; selectedData.id=null; if(e.rowType==="data" ) { + e.component.editRow(e.rowIndex); } */ }, onSaved() { logEvent('Saving Success'); }, onEditCanceling() { // + logEvent('EditCanceling'); }, onEditCanceled() { // logEvent('EditCanceled'); }, onFocusedRowChanging(e) { // + console.log(e); }, sorting: { mode: "multiple" // or "multiple" | "none" }, \ No newline at end of file diff --git a/resources/views/admin/type/document-revision.blade.php b/resources/views/admin/type/document-revision.blade.php index 03f6473..2bbd0a3 100644 --- a/resources/views/admin/type/document-revision.blade.php +++ b/resources/views/admin/type/document-revision.blade.php @@ -185,7 +185,7 @@ $topButtons = [