EasyUI Forum
April 25, 2024, 04:00:54 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
1  General Category / EasyUI for jQuery / Re: SUBGRID ROWEDITING - onClickCell not working on: April 29, 2023, 04:11:35 AM
Dear Jarry,

thanks for your reply, but in your answer nothing is editable.
And my problem refers to an editable subgrid.

Thx again!
Michael.
2  General Category / EasyUI for jQuery / SUBGRID ROWEDITING - onClickCell not working on: April 26, 2023, 12:52:18 PM
Hi,
sorry one more request for help in the context of rowediting with a subgrid.

appendrow and insertrow work fine and put the entire line on editing, with tabindex OK etc.

just when I apply any standard version of onClickCell that usually works fine for a datagrid,
with the subgrid it simply does not work. Problem is when clicking a cell only this cell goes into editing,
but not the entire row as in append and insert. This causes then several problems incl. with tabindex.

Thanks again in advance!
Greetings from Vienna.
BR Michael.

Code:
        function onClickCell(index, field)
        {
            if (editIndex != index)
            {
                if (endEditing())
                {
                    // next lines simply not working, whatever datagrid reference I put...
                    // strange is even if I click row 1 and put f.e. "2" hard coded instead of index
                    // then the cell I clicked in row 1 gets in edit mode, and full line 2 is in edit mode
                    // just if I click cell in row 1 and put index 1 then just this one cell and not the full line gets in edit mode
                    $('#dg').datagrid('selectRow', index)
                            .datagrid('beginEdit', index);
                    // -------------------------------------------------------------------       
                           
                    var ed = $('#dg').datagrid('getEditor', {index:index,field:field});
                    if (ed){
                        ($(ed.target).data('textbox') ? $(ed.target).textbox('textbox') : $(ed.target)).focus();
                    }
                    editIndex = index;
                }
                else
                {
                    setTimeout(function(){
                        $('#dg').datagrid('selectRow', editIndex);
                    },0);
                }
            }
        }
3  General Category / EasyUI for jQuery / Re: ROWEDITING: how to copy date from one column in editmode to next column? on: April 26, 2023, 02:42:43 AM
Thanks for help,
I understand and get this working with a normal datagrid, just I use an editable subgrid for which I need this
and it seems I simply dont get the reference to this editable subgrid right in the code.
Whatever I put here instead of dg like ddv, $(this)... etc I dont get the editor correctly and hence the setValue is not working.

Once again thanks and Greetings from Vienna!
Michael.

Code:
						field: 'termin', title: 'Termin Kunde', width: 200, editor: {
type: 'datebox',
options: {
icons: [{
iconCls: 'icon-ok',
handler: function (e) {
var val = $(e.data.target).datebox('getValue');
var ed = dg.datagrid('getEditor', { index: editIndex, field: 'planung' });
$(ed.target).datebox('setValue', val);
}
}]
}
}

4  General Category / EasyUI for jQuery / SUBGRID ROWEDITING: how to copy date from one column in editmode to next column? on: April 25, 2023, 09:53:57 AM
Hi,

I want to copy - during row editing - a date from one column to another (and maybe change date during copy as required).

With documentation I got to add a button in the datebox field and also an additional button in bottom of the datebox calendar.
See screenshot attached.
Just I cannot get, that on pressing one of these to set the actual date or anything else to the next datebox column... please for help!

Calculating 2 columns example did not help as I want the copy to happen on a button click and not on onChange.
https://www.jeasyui.com/tutorial/datagrid/datagrid15.php

Thanks and BR Michael!  

what I tried...

Code:
{field:'client_date',title:'Termin Kunde',width:150,align:'center',...
{field:'ops_date',title:'Planung OPS',width:120,align:'center',...


// ---------------------------------------------------------------------------------
// not working code in handler for icon-ok
// ---------------------------------------------------------------------------------
                                               buttons: datebox_buttons,
                                                                        required:false,
                                                               formatter: myformatter,
                                                               parser:    myparser,
                                                                        currentText:    'Heute',
                                                                        closeText:      'Schließen',
                                                                        icons:[
                                                                                {
                                                                                  iconCls:'icon-ok',
                                                                                  handler: function(e)
                                                                                  {
                                                                                    var ed = ddv.datagrid('getEditor', {index:editIndex,field:'client_date'});
                                                                                    var val = ed.target.datebox('getValue','');
                                                                                    alert(val);
                                                                                    
                                                                                    var ed = ddv.datagrid('getEditor', {index:editIndex,field:'ops_date'});
                                                                                    // not working
                                                                                    ( $(ed.target).data('textbox') ? $(ed.target).textbox('textbox') : $(ed.target) ).datebox('setValue',val);
                                                                                    
                                                                                  }
                                                                                },
                                                                                {
                                                                                  iconCls:'icon-clear',
                                                                                  handler: function(e)
                                                                                  {
                                                                                    // SET FOCUS ON 'OWN' COLUMN WORKS....
                                                                                    var ed = ddv.datagrid('getEditor', {index:editIndex,field:'client_date'});
                                                                                    ed.target.datebox('setValue','');
                                                                                    ed.target.datebox('setText','');
                                                                                    ( $(ed.target).data('textbox') ? $(ed.target).textbox('textbox') : $(ed.target) ).select();
                                                                                    ( $(ed.target).data('textbox') ? $(ed.target).textbox('textbox') : $(ed.target) ).focus();
                                                                                  }
                                                                                }
                                                                              ]  

// ---------------------------------------------------------------------------------
// not working code in datebox_buttons
// ---------------------------------------------------------------------------------
  var datebox_buttons = $.extend([], $.fn.datebox.defaults.buttons);
  datebox_buttons.splice(1, 0, {
      text: 'CONFIRM',
      handler: function(target)
      {
          alert('click MyBtn');
          
          var ed = $(this).datagrid('getEditor', {index:editIndex,field:'ciient_date'});
          var val = ed.target.datebox('setValue','');  
          alert( val );

          var ed = SubDG.datagrid('getEditor', {index:editIndex,field:'ops_date'});
          ed.target.datebox('setValue',val);
          ed.target.datebox('setText',val);
          ( $(ed.target).data('textbox') ? $(ed.target).textbox('textbox') : $(ed.target) ).select();
          ( $(ed.target).data('textbox') ? $(ed.target).textbox('textbox') : $(ed.target) ).focus();
      }
  });  

5  General Category / EasyUI for jQuery / [Solved] Re: Datagrid: possible to have groupview and a subgrid together? on: April 21, 2023, 02:57:50 PM
fantastic - thank you jarry!!!
6  General Category / EasyUI for jQuery / Re: Datagrid: possible to have groupview and a subgrid together? on: April 17, 2023, 03:13:49 PM
Any help? Pleaaaase... Wink))
7  General Category / EasyUI for jQuery / [SOLVED] Datagrid: possible to have groupview and a subgrid together? on: April 10, 2023, 01:11:10 AM
Hi,

I use groupview in a table and would like to add a subgrid below every row.
I think I cannot simply use "subgrid" or "nested subgrid" because then I loose my grouping mechanism on top.
Any idea how this can be done?

Example: See https://www.jeasyui.com/tutorial/datagrid/datagrid31_demo.html
Here I would like the master grid options to hold groupview but it does not work

Code:
			options:{
                   view:groupview,
                                groupField: 'company',
                   groupFormatter:function(value,rows)
                                {
                                    alert('hello groupview here');
                                    return value + ' - ' + rows.length + ' Item(s)';
                                },
fitColumns:true,
columns:[[
{field:'company',title:'Company Name',width:200},
{field:'contact',title:'Contact Name',width:200},
{field:'country',title:'Country',width:200}
]],
data:[
                                   {company:'COMPANY-1',contact:'Minna John',country:'Sweden'},
                                   {company:'COMPANY-1',contact:'Jack Nicholson',country:'Austria'},
                                   {company:'COMPANY-2',contact:'Freddy Mercury',country:'Germany'},
                                   {company:'COMPANY-2',contact:'Alex Bolton',country:'Italy'}
]
}



Thx in advance and Greetings from Vienna, Michael!
8  General Category / EasyUI for jQuery / Re: texteditor - how to set cursor/focus after 'insertContent' on: January 12, 2022, 09:38:03 AM
Hallelujah - its magic Wink))
Thanks a lot Jarry!
9  General Category / EasyUI for jQuery / Re: texteditor - how to set cursor/focus after 'insertContent' on: January 10, 2022, 04:02:13 AM
Dear Jarry,

thx a lot, but seems this is just working, when inserting text into empty editor.

When editor already filled and I click on any position inside the text there, then my function properly inserts the text at this position, but I dont get the cursor after the inserted text in this case (its always in beginning of all text in line 1, pos 1...).

Please for a final hint to get this up & running & done Wink))) THX!

Or how would a GetCursor/SetCursor, respectively GetSelectedText/SelectText function have toi look in general?

Code:
        function InsertText(txt)
        {
          var str = $('#myTextEditor').texteditor('getValue').trim();
          logconsole("str=["+str+"] len=["+str.length+"]");
          if ( (!str) || (str.length < 1 ) )
          {
            // THIS part WORKS... cursor is set after the inserted TEXT
            logconsole("Editor empty");
            $('#myTextEditor').texteditor('getEditor').focus();
            $('#myTextEditor').texteditor('getEditor').trigger('mouseup');
            $('#myTextEditor').texteditor('insertContent', '<span>'+txt+'</span>');
            $('#myTextEditor').texteditor('options').selectedRange.collapse(false);
          }
          else
          {
            // DOES NOT WORK... TEXT inserted properly at actual cursor, but focus always goes to line1, pos1 in the beginning of all text in the texteditor
            logconsole("Editor filled, inserting at actual cursor position");
            $('#myTextEditor').texteditor('insertContent', '<span>'+txt+'</span>');
            $('#myTextEditor').texteditor('getEditor').focus();
            //$('#myTextEditor').texteditor('getEditor').trigger('mouseup');
            $('#myTextEditor').texteditor('options').selectedRange.collapse(false);
          }

          return true;
        }


 
10  General Category / EasyUI for jQuery / [SOLVED] texteditor - how to set cursor/focus after 'insertContent' on: January 07, 2022, 01:56:45 PM
Hi,

after inserting text with 'insertContent', how can I manage to get the cursor/focus right after the text inserted?
Below code properly inserts the text (f.e. from a popup menu), but focus is always set to beginning of first line.
To make sense for this, I want the user to continue typing right after the pasted text.

Code:
        function InsertText(txt)
        {
          $('#myTextEditor').texteditor('insertContent', '<span>'+txt+'</span>');
          //$('#myTextEditor').texteditor('getEditor').focus().select();
          $('#myTextEditor').texteditor('getEditor').trigger('mouseup');
        }

Thx a lot as always!!!
BR Mike.
11  General Category / EasyUI for jQuery / Re: cell editing and combobox mouse click for selection not working on: December 10, 2020, 03:20:48 PM
Jarry, works like a charm - THANKS A LOT!!!!

BR Mike.
12  General Category / EasyUI for jQuery / Re: cell editing and combobox mouse click for selection not working on: December 08, 2020, 04:12:17 AM
Any help?

Cannot just trigger endEdit or react on onSelect/onChange event, as this interferes with the edit mode and initial load of the combobox.
I just want, that when click in the dropdown panel, then it is already like the "enter" needed to be pressed afterwards.
Because mouse click and then having to press enter with keyboard is not convenient for the user.

Thx again, Mike.
13  General Category / EasyUI for jQuery / Re: cell editing and combobox mouse click for selection not working on: December 04, 2020, 09:46:18 AM
Hi Jarry,

thx for reply - but in the example you refer to, exactly the event 'onAfterEdit' is not fired,
when you click the comboxbox and then click/select an entry in the dropdown panel.
Thats exactly what I would expect and need, that this event 'onAfterEdit' fires, but it just closes the dropdown...

Thx Mike!
14  General Category / EasyUI for jQuery / cell editing and combobox mouse click for selection not working [SOLVED] on: December 01, 2020, 03:33:23 PM
Hi,

I am using cell editing with combobox and with below code the key nav incl. enter / endediting works fine.
Quote
                                 keyHandler: $.extend({},$.fn.combobox.defaults.keyHandler,{
                                      down: function(e){
                                          $(this).combobox('showPanel');
                                          $.fn.combobox.defaults.keyHandler.down.call(this,e);
                                      }
                                  }),

Also managed to have the panel open when clicking the combobox with 'showPanel' ,
just when I click one of the entries in the dropdown the panel then just closes,
but simply not the "same" happens as when pressing "enter" with kay nav -
means f.e. that onAfterEdit is not called (like when key nav enter pressed) where all the saving happens.

And when I try adding "endEdit" in onChange of the combobox editor then all gets messed up,
because combobox obviously also tiggers onChange with the initial click on the combobox...

Please for help how to get right... and thx a lot in advance!

BR Mike.
15  General Category / EasyUI for jQuery / Re: cell editing and combobox on: November 27, 2020, 11:55:29 AM
PERFECT and THX!!!
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!