Action buttons are added to jqGrid columns using colmodel below. Column width 45 is sufficient to hold both buttons in same row. Edit and delete buttons appear in separate rows and row height in increased. For unknown reason there is empty space before both buttons, there do not appear in left side in column.
If inline edit starts, save and cancel button also appear in separate rows.
How to force buttons to appear in same row witohut increasing column width ?
grid.jqGrid({
colModel: [{name:_actions,width:45,
formatter:"actions",
formatoptions:
{keys:true}
}, ....
update
Toolbar containts text right to button. Removing 30px from style creates overlapping buttons so I cannot remove it.
According to Oleg suggestion I added
.ui-inline-edit, .ui-inline-del, .ui-inline-save, .ui-inline-cancel
{
margin-right: 0px !important;
}
and
colModel: [{"hidden":false,"label":" Muuda ","name":"_actions","width":($.browser.webkit == true? 58: 53)
,"align":"center","sortable":false,"formatter":"actions","formatoptions":{"keys":true,"delbutton":false,"onSuccess":function (jqXHR) {
actionresponse = jqXHR;
return true;
}
,"afterSave":function (rowID) {
cancelEditing($('#grid'));aftersavefunc(rowID,actionresponse)}
,"onError":errorfunc
,"extraparam":{"_dokdata":FormData
},"afterRestore":setFocusToGrid
,"onEdit":function (rowID) {
if (typeof (lastSelectedRow) !== 'undefined' && rowID !== lastSelectedRow)
cancelEditing($('#grid'));
lastSelectedRow = rowID;
}
}},
to style but this does not change anything, buttons still appear in two rows. How to fix ?
Update 2
adding fixed: true puts buttons to same row. There are two issues:
Buttons are two small
Column contains only edit button ( delbutton:false option used). Edit button width is small and icon is not centered. How to increase edit button width to column width-few pixels so that clicking anywhere in column starts edit mode and show edit icon in center of column ? How to increase save ad cancle button widths so that both occupy 50%- few pixels of action column width?
Multiple rapid clicks cause edit button so stop working
Save button appears in the same place as edit button and save to server takes some time. If This place is clicked rapidly, inline edit mode is toggled before save is completed and autocomplete controls are not created anymore. after that edit button does not work at all. How to prevent multiple save button clicks: disable save button or whole grid if clicked once or other solution and show "Saving..." message until save is completed?
style used:
td.ui-pg-button > div.ui-pg-div { margin-right: 30px }
colmodel:
colModel: [{
fixed:true,
label:" Change ",
name:"_actions",
width:($.browser.webkit == true? 58: 53)
,align:"center",
sortable:false,
formatter:"actions",
formatoptions:{"keys":true,"delbutton":false,
"onSuccess":function (jqXHR) {actionresponse = jqXHR;return true;}
,"afterSave":function (rowID) {
cancelEditing($('#grid'));aftersavefunc(rowID,actionresponse);actionresponse=null; }
,"onError":errorfunc
,"extraparam":{"_dokdata":FormData
},
afterRestore:setFocusToGrid
,onEdit:function (rowID) {
if (typeof (lastSelectedRow) !== 'undefined' && rowID !== lastSelectedRow)
cancelEditing($('#grid'));
lastSelectedRow = rowID;
}
}}