Show Posts
|
Pages: [1] 2 3
|
2
|
General Category / EasyUI for jQuery / [SOLVED] Swap rows in datagrid
|
on: October 05, 2023, 03:28:17 PM
|
Hi, I would like to add a button that allows the rows to be swapped up and down. I found a post from 2014, but it doesn't work https://www.jeasyui.com/forum/index.php?topic=3634.0Snippet of the code function dgSwapColumns(from, to) { $('#dg).datagrid('moveRow', { from: from, to: to }); }
It gives me this error Uncaught TypeError: $.fn.datagrid.methods[_8ee] is not a function at $.fn.datagrid (<anonymous>:12356:35) at dgSwapColumns ((index):89:30) at HTMLAnchorElement.onclick ((index):1:1)
|
|
|
3
|
General Category / EasyUI for jQuery / EasyUI Desktop vs Mobile
|
on: August 11, 2023, 06:06:00 AM
|
Has anyone encountered such a situation? It works very well on a computer, but if the page is loaded on a tablet/phone it doesn't work so well, it's even hard to work with. For example datagrid, messager is very slow
|
|
|
5
|
General Category / EasyUI for jQuery / [Solved] Adding columns dynamically with formatter and styler as string
|
on: July 20, 2023, 11:03:49 AM
|
Hi, How could I solve my problem? I tried eval(); and (function() {})(); Code function refreshDatagrid() { const columns = $('#datalist').datalist('getRows'); $('#datagrid').datagrid({ columns: [columns] }); }
Data [ { "field": "field_fdqzv", "title": "title" }, { "field": "field_2agdu", "title": "2agdu", "_selected": true, "width": 200, "align": "center", "formatter": "function (value, row, index) {\n\treturn value + ' ' + index;\n}", "styler": "" } ]
|
|
|
7
|
General Category / EasyUI for jQuery / [Solved] Error on Drag and Drop Datagrid
|
on: July 17, 2023, 03:34:13 PM
|
Hi, Am having a problem w drag and drop on my Datagrid Uncaught TypeError: Cannot read properties of undefined (reading 'jQuery3310090322002266437942') at Q.get (jquery.min.js:2:32502) at Q.access (jquery.min.js:2:32622) at Function.data (jquery.min.js:2:33477) at Object.options (jquery.easyui.min.js:12493:12) at $.fn.datagrid (jquery.easyui.min.js:12356:35) at getDraggingRow (datagrid-dnd.js:390:27) at HTMLTableRowElement.onBeforeDrag (datagrid-dnd.js:152:25) at HTMLTableRowElement.<anonymous> (jquery.easyui.min.js:638:21) at HTMLTableRowElement.dispatch (jquery.min.js:2:41772) at y.handle (jquery.min.js:2:39791)
And also is there a way to import drag and drop to datalist?
|
|
|
10
|
General Category / EasyUI for jQuery / Re: DataList doesn't refresh after updateRow
|
on: July 15, 2023, 11:52:47 AM
|
Maybe there is a bug in my function? function saveInfo() { if (!($('#form').form('validate'))) { return; } const formData = $('#form').serializeArray(); if (fieldIdx >= 0) { const clickedField = $('#datalist').datalist('getRows')[fieldIdx]; formData.forEach(e => { clickedField[e.name] = e.value; }); $('#datalist').datalist('updateRow', { index: fieldIdx, row: clickedField }).datalist('refreshRow', fieldIdx); } $('#win').window('close'); }
|
|
|
12
|
General Category / EasyUI for jQuery / Re: Context Menu on DataGrid + showColumn / hideColumn
|
on: May 18, 2023, 10:27:11 AM
|
I got back into my project and found I think the simplest solution  (function ($) { function buildMenu(target) { const state = $(target).data("datagrid"); if (!state.columnMenu) { state.columnMenu = $("<div></div>").appendTo("body"); state.columnMenu.menu({ onClick: function (item) { if (item.iconCls == "tree-checkbox1") { $(target).datagrid("hideColumn", item.name); $(this).menu("setIcon", { target: item.target, iconCls: "tree-checkbox0" }); } else { $(target).datagrid("showColumn", item.name); $(this).menu("setIcon", { target: item.target, iconCls: "tree-checkbox1" }); } $(state.columnMenu).show(); // HERE } }) const fields = $(target).datagrid("getColumnFields", true).concat($(target).datagrid("getColumnFields", false)); for (var i = 0; i < fields.length; i++) { var field = fields[i]; var col = $(target).datagrid("getColumnOption", field); if (col.hidden) { state.columnMenu.menu("appendItem", { text: col.title, name: field, iconCls: "tree-checkbox0" }); } else { state.columnMenu.menu("appendItem", { text: col.title, name: field, iconCls: "tree-checkbox1" }); } } } return state.columnMenu; } $.extend($.fn.datagrid.methods, { columnMenu: function (jq) { return buildMenu(jq[0]); } }); })(jQuery);
|
|
|
|