EasyUI Forum
May 05, 2024, 07:14:31 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: 1 [2] 3 4
16  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
Code:
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?
17  General Category / EasyUI for jQuery / Re: Disable move to next input field in form by tab on: July 17, 2023, 11:00:02 AM
Code:
inputEvents: {
            keydown: function (e) {
                if (e.keyCode === 9) {
                    e.preventDefault();
                    const val = this.value, start = this.selectionStart, end = this.selectionEnd;
                    this.value = val.substring(0, start) + '\t' + val.substring(end);
                    this.selectionStart = this.selectionEnd = start + 1;
                }
            }
        }
18  General Category / EasyUI for jQuery / [Solved] Disable move to next input field in form by tab on: July 15, 2023, 12:02:04 PM
Hi,
How can I disable moving to next input field in form by clicking tab and making '\t' in text field.
19  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?

Code:
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');
}
20  General Category / EasyUI for jQuery / DataList doesn't refresh after updateRow on: June 29, 2023, 03:12:09 PM
After usage updateRow it needs to use refreshRow.
Code:
$('#dl').datalist('updateRow', { index: idx, row: row}).datalist('refreshRow', idx);
21  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  Smiley

Code:
(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);
22  General Category / EasyUI for jQuery / Re: EasyUI Datagrid Export on: April 19, 2023, 11:54:52 PM
After iteration over the items
Code:
items.forEach(el => {
    delete el.id;
    delete el.children;
});

Works as it should
Thanks!
23  General Category / EasyUI for jQuery / [SOLVED] EasyUI Datagrid Export on: April 14, 2023, 06:47:09 AM
Hi,
Is there a way to export a datagrid to XLSX not to XLS?
Why does it show that the file is in a different extension than XLS when I open it in Excel but the end of the file is XLS?

Regards
24  General Category / EasyUI for jQuery / Re: Context Menu on DataGrid + showColumn / hideColumn on: April 05, 2023, 12:49:34 PM
Have you got the solution for "Is it possible to avoid that the "Context Menu" closes after selecting/unselecting a checkbox ?" ?
25  General Category / EasyUI for jQuery / Columns Extension event for the wrong position of the object on: April 05, 2023, 12:26:11 PM
Hello,
Is it possible to add options to the extension so that an event can be triggered when the pointer is out of accept of the proxy?
Like in the image in attachment
26  General Category / EasyUI for jQuery / Re: Datebox can input 0 and save on: March 01, 2023, 01:43:19 AM
Works perfect  Grin
27  General Category / EasyUI for jQuery / Datebox can input 0 and save on: February 28, 2023, 02:54:52 AM
Hi,
I have a problem with datebox as editor in datagrid. I can input 0 in day/month/year like '2023-00-12' or '0000-03-14' and it will accept it and save, but if i edit while its '0000-12-1230' it will show as '1900-12-30'.
28  General Category / EasyUI for jQuery / Re: Datagrid options get values from object on: February 08, 2023, 04:13:53 PM
Oh also i found out how to make function from database saved in JSON to run.

Code:
columns.forEach(col=>{if(col.formatter){col.formatter=JSONfn.parse(JSONfn.stringify(col.formatter));}});
If there's a better way to do this, I'd be very happy to help, because at the moment I haven't come up with anything else Cheesy
29  General Category / EasyUI for jQuery / Re: Datagrid options get values from object on: February 08, 2023, 03:13:15 PM
Ok I found a plugin to JS for JSON https://github.com/vkiryukhin/jsonfn that shows the function inside
30  General Category / EasyUI for jQuery / Re: Datagrid options get values from object on: February 08, 2023, 02:33:08 PM
Thanks for your answer, but I think I misunderstood the question. I would like to get the code from "formatter" like below because I can't find it in that form.
Code:
formatter: function (value, row, index) {
    if (row.id_tc_bom == null && row.id_tc_object > 0 && row.id_status < 99) {
        return '<a style="color:inherit;" href="javascript:void(0)" onclick="horWinPrzypiszIDBomWin(0,'+row.id+')">'+value+'</a>';
    } else {
        return value;
    }
}
Pages: 1 [2] 3 4
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!