Show Posts
|
Pages: [1]
|
2
|
General Category / EasyUI for jQuery / Enable/disable checkbox on Combobox change in editable datagrid
|
on: February 13, 2023, 08:06:00 AM
|
Hello, I have an editable Datagrid with (among others) a Combobox column and what's supposed to be a checkbox soon (the labassist one), and I want to enable or disable the checkbox individually for each row, depending on what is initially selected or gets selected in the Combobox. Is this doable? I don't fully understand how to access both the Checkbox or Combobox later. By the way, all rows from the datagrid are editable at the same time. I'm not sure whether thats important. Code snippets: $('#dg-manageruns').datagrid({ onLoadSuccess: function(data) { for (var i=0; i<$(this).datagrid('getData').rows.length; i++) { $(this).datagrid('beginEdit', i); } }, columns: [[ {field: 'labassist', title: 'Assist', sortable: true, formatter:function(value, row, index) { return value==1 ? "X" : value==0 ? "" : value; }, // editor:{ (.............) }, {field: 'setup', title: 'Setup', sortable: true, width:180, editor:{ type:'combobox', options:{ valueField:'id', textField:'setupname', data: listsetups, panelWidth:320, } } }, (...)
Thanks for any help.
|
|
|
4
|
General Category / EasyUI for jQuery / Datagrid problem on adding row multiple times
|
on: November 01, 2021, 04:58:34 PM
|
Hello, I have a datagrid: $('#dg').datagrid({ columns: [[ {field: 'func', title: '', sortable: false, formatter: function(value, row, index) { var s = '<button class="icon-add" onclick="addDatagridRow('+index+')" style="width:16px; height:16px; border:0"></button>'; return s; } }, //...
And the function to add a row. It's supposed to add one right below the row, that has been clicked. function addDatagridRow(index) { var row = $('#dg).datagrid('getRows')[index]; $('#dg).datagrid('insertRow', {index:index+1, row:{setup: row.setup, setupid: row.setupid}}); }
When I add one row, everything is fine. But when I add another, the indexes aren't correct anymore. It looks like the value was fixed when the datagrid was initialized. For example I have 3 rows with indexes: 1, 2, 3 And I add a row in the middle, the indexes are: 1, 2, 3, 3 The last row, although being in the 4th position, the formatter returns the value it has been initialized with. I'm sorry, I don't know how to better explain this. Is there a way to update the formatter, or the column? Or am I doing something wrong? Thank you in advance for any help.
|
|
|
7
|
General Category / EasyUI for jQuery / Re: $.messager.prompt Ok and Cancel callback
|
on: August 30, 2020, 03:12:03 PM
|
I wanted 3 possibilities and experimented a bit, so in case someone is ever interested in this: $.messager.prompt('My Title', 'Please type something', function(r){ if (r) { console.log('ok clicked, r = '+r); } else if (r == undefined) { console.log('cancel clicked'); } else if (r.localeCompare("")==0) { console.log('ok clicked, but r is EMPTY'); } });
|
|
|
9
|
General Category / EasyUI for jQuery / datagrid with filter and checkbox
|
on: March 11, 2020, 04:13:11 AM
|
I have something like $('#dg').datagrid({ columns: [[ {field:'check', checkbox:true}, {...} ]] }); $('#dg').datagrid('enableFilter');
And when I do filter, all previously checked rows become unchecked. Neither $('#dg').datagrid('getChecked') returns the expected values, nor are the displayed rows after filtering no longer checked if they were before. How do I solve this?
|
|
|
10
|
General Category / Bug Report / Tagbox DropDownArrow scrolling upwards
|
on: October 20, 2018, 04:01:39 PM
|
I have a Tagbox, with remote data, style="max-height: 100px" and hasDownArrow=true. As soon as there are enough values for the box to be full and needing scrolling, the downArrow also scrolls until it disappears completely.
|
|
|
11
|
General Category / EasyUI for jQuery / Combobox with multiple and searchbox/filter?
|
on: July 25, 2018, 06:21:56 AM
|
Hi,
I have a basic Combobox with multiple:true and a lot of data, so I want the user to have some sort of search field to reduce the results in the dropdown. Now without multiple one can type directly into the Combobox, however with multiple it's not working correctly. Can I maybe add a search field in the dropdown or something?
Thanks.
|
|
|
12
|
General Category / EasyUI for jQuery / Combotreegrid custom textField not working
|
on: January 07, 2017, 09:47:35 AM
|
I had a combogrid, which looked like this: $('#cg').combogrid({ idField:'id', textField:'custom_desc', columns:[[ {field:'desc1', title:'Description1', width:50}, {field:'desc2',title:'Description2',width:200} ]] });
Where as the user selected a value, the "custom_desc", which is composed from multiple columns, appeared in the combo field. Now I've updated to combotreegrid and this is no longer working. The parameter "treeField" replaces "textField" and only this one column is displayed in the box, when a value is selected, textField is ignored. I've tried to work around with "onSelect" method, but it doesn't work either. onHidePanel is working fine, if the panel is closed without selecting anything. On the other hand though, when selecting, onSelect is fired twice with onHidePanel once inbetween, and "setText" is ignored everywhere. To be precise: it's not completely ignored, it's stored as the combotreegrids text, but it's not displayed in the combo. Instead the "treeField" is displayed. Is this a bug or am I doing something wrong? Here's the code: $('#cg').combotreegrid({ idField:'id', treeField:'desc1', textField:'custom_desc', columns:[[ {field:'desc1', title:'Description1', width:50}, {field:'desc2',title:'Description2',width:200} ]], onSelect: function(row) { console.log("onSelect"); $('#cg').combotreegrid('setText', 'something got selected...'); }, onHidePanel: function() { console.log("onHidePanel"); $('#cg').combotreegrid('setText', "PANEL HIDDEN AJAJAJAJAJ"); } });
|
|
|
|