EasyUI Forum
November 04, 2025, 09:33:56 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: edatagrid with linkbutton to dialog  (Read 9008 times)
ShockRaver
Newbie
*
Posts: 8


View Profile
« on: July 23, 2014, 07:12:09 AM »

In my editable datagrid i would like a dialog to pop up when i enter onEdit, or just before a row is updated.

This dialog should contain a textarea and an "ok" button. When OK is clicked and the row in the datagrid is going to update, the text in the textarea should also be posted to the updateUrl.

Maybe dialog isn't the way to go, i don't know.

Anybody any ideas on how to do this?

Eelco
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: July 24, 2014, 01:33:30 AM »

If you are using the edatagrid plugin, please assign the 'textarea' editor to the field. Thus you will get the inline-editing datagrid and don't need a dialog again when editing a row.
Logged
ShockRaver
Newbie
*
Posts: 8


View Profile
« Reply #2 on: July 24, 2014, 02:08:42 AM »

Thx, i am using that now, but it is bound to the width of the column....

Or can i manipulate it?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: July 24, 2014, 06:19:04 AM »

Please refer to this example http://jsfiddle.net/7NrQ4/1/
Logged
ShockRaver
Newbie
*
Posts: 8


View Profile
« Reply #4 on: July 25, 2014, 04:21:23 AM »

Thx for the input.

I also found another way, here it is:

jquery.easyui.min.js add this:

Code:
$.extend($.fn.datagrid.methods,{
resizeColumn:function(jq,param){
return jq.each(function(){
var dg = $(this);
var col = dg.datagrid('getColumnOption', param.field);
col.boxWidth = param.width + (col.boxWidth-col.width);
col.width = param.width;
dg.datagrid('fixColumnSize', param.field);
})
}
})

Then the onEdit will work with this:

Code:
var ed = $(this).edatagrid('getEditor',{index:index,field:'comment'});
$(this).datagrid('resizeColumn', {
                       field: 'comment',
                      width: 300
});
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!